Re: anonymous select error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not sure you need a semi-colon after the table name.

$result = mysql_query( 'Select * From newsletter_subscribers', $db );

>>
>>To: php-db-digest@xxxxxxxxxxxxx
>>MIME-Version: 1.0
>>Content-Type: text/plain; charset=us-ascii
>>
>>I'm trying this query:
>>
>>$link = mysql_connect( $site, $id, $pass );
>>if (!$link) {
>>   die('Could not connect: ' . mysql_error());
>>}
>>echo 'Connected successfully<br>';
>>
>>$db = mysql_select_db( $dbname, $link);
>>if( !$db ) {
>>   echo "DB false<br>";
>>   exit;
>>}
>>
>>$result = mysql_query( 'Select * From
>>newsletter_subscribers;', $db );
>>
>>if (!$result) {
>>   echo "DB Error, could not list tables<br>";
>>   echo 'MySQL Error: ' . mysql_error();
>>   exit;
>>}
>>
>>
>>with this output:
>>
>>Connected successfully
>>DB Error, could not list tables
>>MySQL Error:
>>
>>I dont understand why there is an error, but it prints
>>nothing for the error.  Any ideas?  Thanks, Josh



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux