Re: I need an expert to tell me what I am doing wrong

From: Date: Fri, 23 Mar 2001 23:54:46 +0000
Subject: Re: I need an expert to tell me what I am doing wrong
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45378@lists.php.net to get a copy of this message
Something else to investigate could be whether you've passed the db name to the script. If the the name of the db is different to $user, you'll need to do something like $dbname = "whatever"; mysql_select_db("$dbname",$db); Mick On Sat, 24 Mar 2001, YoBro wrote: > What could I possibly be doing wrong here. The information just will not > insert into my database. > ARGH! > > Please help if you can... > > <?php > > $user = "xyz"; > $pass = "123"; > > > //Connect to Database xyz > $db = mysql_connect("localhost", $user, $pass)OR DIE("Unable to connect to > database"); > > mysql_select_db("xyz",$db) OR DIE("Unable to connect to database"); > > $sql = ("INSERT INTO orders VALUES > 'product,name,email'($product,$name,$email)"); > $result = mysql_query($sql); > echo "Order for the $product has been sent"; > > > ?> > > -- > Regards, > > > YoBro > ------------------------------------------------------------- > DO NOT REPLY TO THIS VIA EMAIL > PLEASE USE THE NEWSGROUP > All emails sent to this address are automatically deleted. > This is to avoid SPAM! > ------------------------------------------------------------- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#45378) next »