Re: PHP won't post to database
From: Pedro Graca (hexkid_at_hotpop.com)
Date: 02/16/04
- Next message: Paul 'piz' Wellner Bou: "Re: Regular expression ?"
- Previous message: Kieran Benton: "PHP with MS SQL on Windows Box"
- In reply to: Dan Weeb: "PHP won't post to database"
- Next in thread: Dan Weeb: "Re: PHP won't post to database"
- Reply: Dan Weeb: "Re: PHP won't post to database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 =--
- Next message: Paul 'piz' Wellner Bou: "Re: Regular expression ?"
- Previous message: Kieran Benton: "PHP with MS SQL on Windows Box"
- In reply to: Dan Weeb: "PHP won't post to database"
- Next in thread: Dan Weeb: "Re: PHP won't post to database"
- Reply: Dan Weeb: "Re: PHP won't post to database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]