i've been attempting to execute this code , all i got was an error.

<?php

$connect = mysql_connect("localhost","root","") or die ("connection failed!");
mysql_select_db("users") or die (mysql_error());


echo "connected!"

$extract = mysql_query("select * from member order by id ASC") or die mysql_error();



?>

and this error appeared : Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\htdocs\xampp\connection1.php on line 9 anybody know why? thanks in advance.

Recommended Answers

All 3 Replies

try:

<?php

$connect = mysql_connect("localhost","root","") or die ("connection failed!");
mysql_select_db("users") or die (mysql_error());


echo "connected!"

$recordset = mysql_query("select * from member order by id ASC") or die( mysql_error());
$row=mysql_fetch_assoc($recordset);
extract( $row );



?>

try:

<?php

$connect = mysql_connect("localhost","root","") or die ("connection failed!");
mysql_select_db("users") or die (mysql_error());


echo "connected!"

$recordset = mysql_query("select * from member order by id ASC") or die( mysql_error());
$row=mysql_fetch_assoc($recordset);
extract( $row );



?>

thanks it works! though i forgot the semicolon ;

You missed semicolon in 7th line.....check it...

echo "connected!";

PS-Don't forget to mark the thread as read if your problem is solved...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.