You want mysql_error(), call it somewhere after your query.

  echo mysql_error();

Regarding the query, the following should work just fine :

  $sql = "INSERT INTO tablefoo (a,b,c) VALUES ('$a','$b','$c')";

Be sure to add slashes sometime to your values beforehand. Anyway,
mysql_error() is what you're wanting.

  http://www.php.net/manual/function.mysql-error.php

regards,
philip


On Thu, 21 Jun 2001, Andreas Skarin wrote:

> I'm sorry guys, neither of the snippets work. I must have screwed something else up
> too. Is there any way I can provoke an error message from your code examples below?
> If anyone manages to find out what's wrong, please tell me. I'm not giving up until
> I smash this bug :-)
> 
> // Andreas
> 
> > Rich Cavanaugh wrote:
> >
> > > try:
> > >
> > > $sql = "INSERT INTO tabell (fornamn, efternamn, email) values ('{$fornamn}',
> > > '{$efternamn}', '{$email}')";
> >
> > Sebastian Wenleder wrote:
> >
> > > I'd use this SQL-query:
> > >
> > > $sql = "INSERT INTO tabell \
> > > (fornamn,efternamn,email) \
> > > VALUES(".$fornamn.", \
> > > ".$efternamn.", ".$email.")";
> 
> 
> 
> 
> --
> Andreas Skarin
> Svenska Dream Theater-Sällskapet
> http://www.sdts.nu - mailto:[EMAIL PROTECTED]
> 
> 
> 
> -- 
> 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]
> 


--
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]

Reply via email to