Eléphanteau du PHP |
10 Messages
17 juil. 2014, 15:59
Bonjour
Merci a toi sirakawa de me consacrer du temps !
J'ai sasie ton script et modifié comme cela :
<?php
$mysql_host="localhost";
$mysql_user="root";
$mysql_pass="seponta";
$mysql_base="visite";
$mysqli = mysqli_connect($mysql_host, $my_sql_user, $mysql_pass, $mysql_base);
$res = mysqli_query($mysqli, "SELECT 'Please, do not use ' AS _msg FROM DUAL");
$row = mysqli_fetch_assoc($res);
echo $row['_msg'];
$mysql = mysqli_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_base);
$res = mysql_query("SELECT 'the mysql extension for new developments.' AS _msg FROM DUAL", $mysql);
$row = mysql_fetch_assoc($res);
echo $row['_msg'];
mais il me genere des erreurs comme suit :
( ! ) Notice: Undefined variable: my_sql_user in C:\wamp\www\visite\install.php on line 14
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
( ! ) Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: YES) in C:\wamp\www\visite\install.php on line 14
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
2 0.0090 256888 mysqli_connect ( ) ..\install.php:14
( ! ) Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:\wamp\www\visite\install.php on line 15
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
2 0.0330 257232 mysqli_query ( ) ..\install.php:15
( ! ) Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in C:\wamp\www\visite\install.php on line 16
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
2 0.0430 257224 mysqli_fetch_assoc ( ) ..\install.php:16
( ! ) Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\visite\install.php on line 19
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
2 0.0540 257504 mysqli_connect ( ) ..\install.php:19
( ! ) Deprecated: mysql_select_db(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\visite\install.php on line 20
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
2 0.0770 257656 mysql_select_db ( ) ..\install.php:20
( ! ) Warning: mysql_query() expects parameter 2 to be resource, boolean given in C:\wamp\www\visite\install.php on line 21
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
2 0.0910 265368 mysql_query ( ) ..\install.php:21
( ! ) Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in C:\wamp\www\visite\install.php on line 22
Call Stack
# Time Memory Function Location
1 0.0010 255616 {main}( ) ..\install.php:0
2 0.1030 265176 mysql_fetch_assoc ( ) ..\install.php:22
ce qui correspond a une erreur sur la ligne suivante :
$mysqli = mysqli_connect($mysql_host, $my_sql_user, $mysql_pass, $mysql_base);
Est ce une erreur du à wamp 2.5 (derniere version) qui ne saurait interpreter le msqli de la ligne php ???