I'm new to this forum & infact am new to PHP also.
i was successful in generating some php code to write records into a table.
everything was fine for couple of months & since yesterday, same is not working when am trying to write records into a table.
I've checked with my hosting server who claims that everything from their end is good.
I've not changed any code in my files which used to work perfect until yesterday.
Here is the problem.
whenever I attempt to write a record into a table, it's inserting a record but only date field is getting populated & all other fields are empty.
here is my php code for database T1_DB & table T1_table
Code: Select all
<?php
include "config.php";
// connect to the mysql server
$link = mysql_connect("localhost", "user_name", "guest")
or die ("Could not connect to mysql because ".mysql_error());
// select the database
mysql_select_db("T1_DB")
or die ("Could not select database because ".mysql_error());
$Date = getdate();
// insert data into database
$insert = mysql_query("INSERT INTO `T1_table` (`Name`, `EMail`, `Comment`, `Date`, `URL`) VALUES ('$Name', '$Email', '$Comment', NOW(), '$url')", $link)
or die("Could not insert data because ".mysql_error());
mysql_close();
?>Code: Select all
<form action="form.php" method="post">
<table width=400 cellspacing=0 cellpadding=2 border=0>
<tr>
<td> <font face=times color="003366"> Name<br>
<input type=text name="Name" value="">
</font> </td>
</tr>
<tr>
<td> <font face=times color="003366"> E-Mail<br>
<input type=text name="Email" value="">
</font> </td>
</tr>
<tr>
<td> <font face=times color="003366"> Comment<br>
<textarea wrap=virtual rows=5 cols=35 name="Comment" ></textarea>
</font> </td>
</tr>
<tr>
<td> <font face=times color="003366"> URL<br>
<input type=text name="url" value="">
</font> </td>
</tr>
<tr>
<td> <font color="003366"><br>
<font face=times>
<input name="submit" type=submit value="Sign my Guestbook">
<input name="reset" type=reset value="Clear form">
</font></font> </td>
</tr>
</table>
</form>