PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am new to the forum which I found accidentally just now and I am all exited.
Can I ask you first of all what version of phpBB the forum uses as I haven't seen this setup before?
I am a php novice and a program that I am using writes four values to a MySql database the last being "joindate" using now() in a date fiekl and the records are retrieved looping through an array into a list. The date text is in US format and I want to change it to D j M Y. I have tried this but it does not work. Any help would be greatly appreciated:
$r = mysql_query ("SELECT SQL_CALC_FOUND_ROWS id FROM $table ORDER BY login LIMIT $xlimit,$ylimit;");
$r1 = mysql_query("SELECT FOUND_ROWS() as total;");
$f1 = mysql_fetch_assoc($r1);
$r_rows = mysql_num_rows($r);
for ($x=0;$x<$r_rows;$x++){
$f = mysql_fetch_assoc($r);
$user_list[$x][id] = $f[id];
$rb = mysql_query("SELECT id FROM $table_list WHERE userid='$f[id]';");
for($xb=0;$xb<mysql_num_rows($rb);$xb++){
$fb = mysql_fetch_assoc($rb);
$user_listing[$f[id]][$xb] = $fb[id];
$fb["joindate"]= date("D j M Y", strtotime($datestring));
Here is what the field looks like after the script runs:
"User login" "User ID" Joined: 2009-06-23
"User Mail"
With datestring, I thought that it was part of the strtotime function so I don't know what the value is or if I need to declare it first. Without it php gives me this error:
Warning: date() expects parameter 2 to be long, string given in g:\xampp\,,,,\user.php line 548 which corresponds to the function.