Hi,
I am a new member and also new in php/mysql.
Thanks a lot for the tutorial, it is a great help for people who just started learning php.
I am trying to do something very similar with the tutorial but keep getting an sql error when I try to add a new record.
The only difference is that I have some extra fields : "from" "to" "reason" are varchar, "amount" is a decimal and "date" is a timestamp.
I am using a form just like the tutorial to add new data:
<form action="" method="post">
<div>
<strong>From: *</strong> <input type="text" name="from" value="<?php echo $fromm; ?>" /><br/>
<strong>To: *</strong> <input type="text" name="to" value="<?php echo $too; ?>" /><br/>
<strong>Amount: *</strong> <input type="text" name="amount" value="<?php echo $amountt; ?>" /><br/>
<strong>Reason: *</strong> <input type="text" name="reason" value="<?php echo $reasonn; ?>" /><br/>
<p>* required</p>
<input type="submit" name="submit" value="Submit">
</div>
</form>
but get an error for this part:
// save the data to the database
mysql_query("INSERT connections SET from='$from', to='$to', amount='$amount', reason='$reason', date=NOW()")
or die(mysql_error());
I would appreciate if someone could help
Thanks!