scottmitchell
Programmer
Hey...
I'm learning PHP script and created a test php file. Have successfully created a database, inserted a table and a record. Now I'm trying to query the database and the query is failing to run (I'm receiving the output from my failure message..."could not query $table".
Here is the code:
$table = "members";
$username = "jsmitchell";
$password = "jm6ga00;";
$membername = "Jeremy Mitchell";
$query = "select from '$table' where username='$username'";
$result = mysql_query($query);
if(! $result)
{
print "Could not query $table";
};
Is there something wrong with this query statement?
Any help would be most appreciated!
Thanks,
Scott M.
I'm learning PHP script and created a test php file. Have successfully created a database, inserted a table and a record. Now I'm trying to query the database and the query is failing to run (I'm receiving the output from my failure message..."could not query $table".
Here is the code:
$table = "members";
$username = "jsmitchell";
$password = "jm6ga00;";
$membername = "Jeremy Mitchell";
$query = "select from '$table' where username='$username'";
$result = mysql_query($query);
if(! $result)
{
print "Could not query $table";
};
Is there something wrong with this query statement?
Any help would be most appreciated!
Thanks,
Scott M.