Related questions
MySQL integer field is returned as string in PHP
I have a table field in a MySQL database:
userid INT(11)
So I am calling it to my page with this query:
"SELECT userid FROM DB WHERE name='john'"
Then for handling the result I do:
$row=$result->fetch_…
Which MySQL datatype to use for an IP address?
Possible Duplicate:
How to store an IP in mySQL
I want to get the IP address from $_SERVER['REMOTE_ADDR'] and some other $_SERVER variables, which datatype is the right one for this?
Is it VARCHAR(n)?
PDO::PARAM for dates?
Does some PDO::PARAM_??? exist which can be used for dates or timestamps?
Sample code:
$sql = "UPDATE my_table SET current_date = :date WHERE id = 43";
$statement = $pdo->prepare ($sql);
$statement->bindParam (":date", strtotime (date ("Y-m-d H:i:s")), …