Robert,

I still feel fairly new to this myself but if I find that I'm having
problems writing to the database I generally try to echo the query to
the page and then test this out directly with the command line prompt
directly to the database.

At least that way you can test out the query in isolation.

Good luck,

Michael

> The following code gets me "document contains no data."  I have done a
> successfull select from mysql db, but not an insertion.
> 
> I don't know how to troubleshoot this.  Any help is much appreciated.
> Thanks!
> 
> <?php
> 
> $id = addslashes($id);
> $visitdate = addslashes($visitdate);
> $img_group = addslashes($img_group);
> $img_url = addslashes($img_url);
> $display = addslashes($display);
> 
> @ $db = mysql_connect("www", "mmc", "mmc-WWW");
> 
>   if (!$db)
>   {
>      echo "Error: Could not connect to database.  Please try again
> later.";
>      exit;
>   }
> 
>   mysql_select_db("mmc");
>   $query = "insert into visitorgallery values
>                 ('".$id."', '".$img_url."', '".$visitdate."',
> '".$img_group."', '".$display."', )";
> 
> 
>   $result = mysql_query($query);
>   if ($result)
>         echo mysql_affected_rows()." Image inserted! ";
> 
> ?>
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to