Page 1 of 1

Trying to load this form to a db but it soesn't wanna work..

Posted: Wed Jul 27, 2005 11:25 am
by gabrielkolbe

Code: Select all

<?php
else {
if(isset($_POST["Submit"])) {

$sale = $_POST["sale"];
$number = $_POST["number"];
$street = $_POST["street"];
$suburb = $_POST["suburb"];
$city = $_POST["city"];
$province = $_POST["province"];
$post = $_POST["post"];
$distance = $_POST["distance"];
$date = time();

$query = "INSERT INTO right_prop_1(prop_ID_1, sale, number, street, suburb, city, province, post, distance, date_auto)
VALUES (NULL, '$sale', '$number', '$street', '$suburb', '$city', '$province', '$post', '$distance', '$date')";
mysql_query($query, $conn) or die(mysql_error());
} 

?>
JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Wed Jul 27, 2005 11:28 am
by John Cartwright
What is being returned?

Posted: Wed Jul 27, 2005 11:42 am
by gabrielkolbe
Nothing! in the database this is the only values it return.The ID and Date basically

VALUES (65, '', 0, '', '', '', '', '', 0, 1122474860);

Posted: Wed Jul 27, 2005 11:51 am
by nielsene
try a print_r($_POST) to see if you're getting the right values in the first place.

Posted: Wed Jul 27, 2005 12:51 pm
by pilau
You wanker you didn't mysql_connect() and mysql_select_db()!!

You must connect to the MySQL server and select a DB first, before you're trying to make changes to it.