Forum Moderators: coopster

Message Too Old, No Replies

need help

         

reexed

3:28 am on Oct 8, 2005 (gmt 0)

10+ Year Member



what is wrong with the scripting below?
can some one tell me please, this is what l get when l preview in the browser
// Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache Group\Apache2\htdocs\phpfiles\opo.php on line 2

$db=mysql_connect("localhost")
mysql_select_db("vinyl",$db);
$query="select*from shops";
$result=mysql_query($query);
$table=mysql_field_table($result)
echo $table;

dreamcatcher

4:30 pm on Oct 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi reexed, welcome to Webmaster World. :)

Each line must be terminated with a semi colon.

$db=mysql_connect("localhost");
mysql_select_db("vinyl",$db);
$query="select*from shops";
$result=mysql_query($query);
$table=mysql_field_table($result);
echo $table;

Hope that helps.

dc

reexed

4:58 pm on Oct 8, 2005 (gmt 0)

10+ Year Member



l have included the semicolon but am still having this error(
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\phpfiles\opo.php on line 2)

thank for ur efforts l will be glad if this is sorted so l can move on with my studies

RonPK

8:45 pm on Oct 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, that means that there is no function mysql_connect() in your version of PHP.
Just a wild guess: are you using PHP 5? If so, you'll need to manipulate some things as MySQL support is no longer embedded in that version. There is some documentation in the manual [php.net].

mcavic

4:51 am on Oct 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In all versions of PHP, MySQL has to be enabled properly, else you will get the undefined function error.