Jump to content

Recommended Posts

Posted

In trying to learn this stuff, I thought I would try to implement this basic script that I copied from zend.com. I got past some of the errors I was getting, but can't get past this area. It is connecting to the database, but then won't get info from the table. Any help????

 

>$dbh=mysql_connect ($hs, $us, $ps)or die ('I cannot connect to the database because: '
 . mysql_error());
mysql_select_db ($db);

$query= "SELECT * FROM $tb"; 
$query_result_handle = mysql_query ($query) 
or die ('<h1><center>I cannot connect to the table because:</center></h1>'. mysql_error());

 

The error I get with the above code is MySQL syntax error. I changed the 6th line to "$sql=..." and got a "query empty" error. Oh...by the way...in the above code, $tb is defined in an included file. I tried putting the table name, but that didn't work either.

 

Thanks,

Tracy

Posted

Thanks for the link and book recommendation. I've got no problem buying a book and plan to do so soon. However, I live out in the boonies...about an hour and 45 minutes away from the closest place to buy such a book. Actually, I will probably buy online, but just haven't done it yet.

 

Never fear...I do listen to "the ones in the know"!!! :)

 

Thanks again,

Tracy

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...