Re: PHP won't post to database

From: Pedro Graca (hexkid_at_hotpop.com)
Date: 02/16/04


Date: 16 Feb 2004 20:32:34 GMT

Dan Weeb wrote:
> If you want me to put a statement in anywhere to check something please let
> me know where you want me to put it as I really am useless with this.

Insert/replace the statements I marked with ###

><html>
>
><body>
>
><?php

### insert this one
echo 'register_globals is ', (ini_get('register_globals'))?('On'):('Off');
###

> if ($submit) {
>
> // process form
>
> $db = mysql_connect("localhost", "uname", "password");

### replace the above with
  $db = mysql_connect("localhost", "uname", "password") or die('No Connection!');
###

> mysql_select_db("dbtouse",$db);

### replace the above with
  mysql_select_db("dbtouse",$db) or die('No Database!');
###

> $sql = "INSERT INTO research_main
> (date_inv,info,medium_name,place_name,date_death,verified_event,closed_event
> ) VALUES
> ('$date_inv','$info','$medium_name','$place_name','$date_death','$verified_e
> vent','$closed_event')";
>
> $result = mysql_query($sql);

### replace the above with
  $result = mysql_query($sql) or die('No Query!');
###

> echo "Thank you! Information entered.\n";
(snip)

-- 
            --= my mail box only accepts =--
            --= Content-Type: text/plain =--
            --=  Size below 10001 bytes  =--