On Sat, 24 Mar 2001 11:07, 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 mysql_error();
> echo "Order for the $product has been sent";
>
>
> ?>
I think you got the solution to your problem, but for future debugging
you might want to add the line above which will spit out a meaningful
error message. You could of course combine that with mysql_errno() for
some error handling branching.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]