DB conn error
Posted by: Sammygreat (---.206.15.47.vgccl.net)
Date: August 03, 2012 06:23PM

kindly help with this problem, i ran the followin code and got the followin error

<?php
$db = mysql_connect("localhost"winking smiley;
mysql_select_db("phpdata1", $db);
$query = "SELECT*FROM shop";
$result = mysql_query($query);
$table = mysql_field_table($result, 0);
echo $table;
?>

ERROR:
SCREAM: Error suppression ignored for
( ! ) Warning: mysql_field_table() expects parameter 1 to be resource, boolean given in C:\wamp\www\samples\db.php on line 6
Call Stack
# Time Memory Function Location
1 0.0008 140648 {main}( ) ..\db.php:0
2 0.0037 147400 mysql_field_table ( ) ..\db.php:6



kindly assist, i have created the database and the table already

Options: ReplyQuote
Re: DB conn error
Posted by: RiggsFolly (---.as13285.net)
Date: August 06, 2012 03:14PM

Do you really want to be displaying the name of the table that you just ran the query on????

If so seperate the SELECT and the * and the FROM with space.

i.e.
$query = "SELECT * FROM shop";

Options: ReplyQuote


Sorry, only registered users may post in this forum.