Jump to content

ThaiAn

Members
  • Posts

    3
  • Joined

  • Last visited

ThaiAn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks i got it
  2. i removed '@' at : if(!mysql_connect($mysql_host,$mysql_user,$mysql_pass) and !mysql_select_db($mysql_db)) it still output 'No database selected'
  3. i have a php file <?php$mysql_host='localhost';$mysql_user='root';$mysql_pass='root';$mysql_db='b_database'; if(!@mysql_connect($mysql_host,$mysql_user,$mysql_pass) and !@mysql_select_db($mysql_db)) { echo 'error';}else{ if($query=mysql_query("SELECT `food`,`color` FROM `food` ORDER BY `id`")) {echo 'ok'; } else { echo mysql_error(); }} ?> when i run the code it always says that no database selected. even i had created a it's database.Sorry for my bad english
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.