Jump to content

[SOLVED] query problem


MDanz

Recommended Posts

<?php
mysql_connect("localhost", "Master", "password");
mysql_select_db("db");

$id = $_GET['id'];




$id = mysql_real_escape_string($id)or die (mysql_error()); ## always do this!!!!
$check = mysql_query("SELECT * FROM Stacks WHERE id='$id'");
    $checknum = mysql_num_rows($check);
    
    if ($checknum==1)
    {
        //run a query to activate the account

        
        $query = mysql_query("UPDATE Stacks SET reportposted ='NOW()' WHERE id='$id'") or die (mysql_error());

    }
    else{
        echo "<font color=white>Invalid ID</font>";
    }
?>

 

i want it to update the row field 'reportposted' with the current time.. but its not working... everytime i check in mysql its 0000-00-00 00:00:00

 

 

Link to comment
https://forums.phpfreaks.com/topic/174705-solved-query-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.