PDA

View Full Version : error message


tcjay
4-3-05, 03:51 PM
I am trying to delete a row in a database table. I receive the following messageand i am not sure what I am doing wrong. Any ideas? TIA TOM


SQL-query :

SELECT * FROM `customers` LIMIT 0, 30

MySQL said:


No database selected

Caligatio
4-3-05, 03:55 PM
Are you doing this directly though phpmyadmin or php?

mitchind
4-3-05, 07:00 PM
You've apparently connected to the database okay (in PHP or Perl), but you haven't selected the database yet - just as the error message implies.

The sequence is

$dbconn = mysql_connect($host, $user, $pwd) or
die ("Error Connecting to MySQL DB: " . mysql_error());
mysql_select_db($database) or
die ("Error Connecting to MySQL DB" . mysql_error());
$result = @mysql_query($query);