from this query while i am trying to select the posts.
$email = mysql_real_escape_string($email);
$r = array();
$r = mysql_query("SELECT
id AS id,
url AS url,
url_key AS url_key,
date AS date,
email AS email
FROM urls WHERE email = '{$email}' ORDER BY date DESC");
while (($row = mysql_fetch_assoc($r)) !== false) {
$r[] = array(
'id' => $row['id'],
'url' => $row['url'],
'url_key' => $row['url_key'],
'date' => $row['date']
);
}
return $r;
You are using $r for two different things, you will need to give one of them a new name. I would also recommend not using single character variable names, why not do with $rows and $result