Hello,
This is my first post. I am Very new to PHP/mySQL and this script was already in place when I received it for this DB. I have just migrated a DB from a server that was using PHP4 to PHP3. I have everything working except the call form the DB for the date... as it displays December 31, 1969 even thought the content in the tables is correct.
if (isset($add)) {
$x_date = date("Y-m-d");
mysql_db_query("$db","INSERT INTO $db_table (d_date, d_title) VALUES ('$
x_date','')");
$id=mysql_insert_id();
}
//remove from db
if (isset($remove)) {
mysql_db_query("$db","delete from $db_table where ID=$remove");
}
//save information to db
if (isset($save)) {
for ($i = 0; $i<=count($id); $i++) {
$x_date = date("Y-m-d", strtotime($d_date[$i]));
mysql_db_query("$db","update $db_table set d_date='$x_date',d_ti
tle='$d_title[$i]' where ID=$id[$i]");
}
}
..... further down
<? for ($i=0; $result && $row=mysql_fetch_array(
$result); $i++) { ?>
<input name="id[<?print($i);?>]" value=http://www.phpbuilder.com/board/archive/index.php/"
<?print($row["ID"]);?>" type=hidden>
<tr>
<td bgcolor="#003399">
<input name="d_date[<?pr
int($i);?>]" value="<?print(date("F j, Y", strtotime($row["d_date"])));?>" type=
text size=20 maxlength=255>
</td>
<td bgcolor="#003399">
<input name="d_title[<?p
rint($i);?>]" value="<?print($row["d_title"]);?>" type=text size=40 maxlength=25
5>
</td>
This is my first post. I am Very new to PHP/mySQL and this script was already in place when I received it for this DB. I have just migrated a DB from a server that was using PHP4 to PHP3. I have everything working except the call form the DB for the date... as it displays December 31, 1969 even thought the content in the tables is correct.
if (isset($add)) {
$x_date = date("Y-m-d");
mysql_db_query("$db","INSERT INTO $db_table (d_date, d_title) VALUES ('$
x_date','')");
$id=mysql_insert_id();
}
//remove from db
if (isset($remove)) {
mysql_db_query("$db","delete from $db_table where ID=$remove");
}
//save information to db
if (isset($save)) {
for ($i = 0; $i<=count($id); $i++) {
$x_date = date("Y-m-d", strtotime($d_date[$i]));
mysql_db_query("$db","update $db_table set d_date='$x_date',d_ti
tle='$d_title[$i]' where ID=$id[$i]");
}
}
..... further down
<? for ($i=0; $result && $row=mysql_fetch_array(
$result); $i++) { ?>
<input name="id[<?print($i);?>]" value=http://www.phpbuilder.com/board/archive/index.php/"
<?print($row["ID"]);?>" type=hidden>
<tr>
<td bgcolor="#003399">
<input name="d_date[<?pr
int($i);?>]" value="<?print(date("F j, Y", strtotime($row["d_date"])));?>" type=
text size=20 maxlength=255>
</td>
<td bgcolor="#003399">
<input name="d_title[<?p
rint($i);?>]" value="<?print($row["d_title"]);?>" type=text size=40 maxlength=25
5>
</td>