MySQL Forums
Forum List  »  PHP

Re: Intermitten error "No Database Selected"
Posted by: D E
Date: October 26, 2005 04:53PM

Hello, I am new to PHP and Mysql and got the No database selected problem while running the following script. Any idea what might be the problem?

The testdb already exists and I did give all the privileges on it to the user.

<?php

$con = mysql_connect("localhost", "*****", "*****");

mysql_select_db("testdb",$con);

$sql = "CREATE TABLE table1 (id int not null primary key auto_increment, field varchar (10))";

$result = mysql_query($sql, $con) or die(mysql_error());

echo $result;
?>

I am using winxp pro, php 5.0.5, apache 2, mysql 4.1.15 nt, client version 5.0.11

Options: ReplyQuote


Subject
Written By
Posted
Re: Intermitten error "No Database Selected"
D E
October 26, 2005 04:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.