Jump to content

Php mysql select


ibnclaudius

Recommended Posts

What is this a. b. c. before the fields? I'm not understanding it. I know is about foreign key and reference, but why a. b. c. ??

 

<?php
$user_id='1'; // User table user_id value
$update_sql=mysql_query("SELECT a.username, a.email, b.update_id, b.update, b.time, b.vote_up, b.vote_down FROM users a, updates b, friends c WHERE b.user_id_fk = a.user_id AND c.friend_one = '$user_id' AND b.user_id_fk = c.friend_two ORDER BY b.update_id DESC LIMIT 15");
while($row=mysql_fetch_array($update_sql))
{
$username=$row['username'];
$email=$row['email'];
$update_id=$row['update_id'];
$update=$row['update'];
$time=$row['time'];
$up=$row['vote_up'];
$down=$row['vote_down'];

//Avatar
$lowercase = strtolower($email);
$image = md5($lowercase);
$avatar ='http://www.gravatar.com/avatar.php?gravatar_id='.$image;

//Update HTML tags filter
$htmldata = array ("<", ">");
$htmlreplace = array ("<",">");
$final_update = str_replace($htmldata, $htmlreplace, $update);


// Updates Results Display here

}
?>

Link to comment
https://forums.phpfreaks.com/topic/250508-php-mysql-select/
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.