0

I'm doing this

$query = mysql_query("SELECT M.msg_id, M.uploads, M.message, M.description, M.type, M.text, M.views_count, U.username, C.name as country_name FROM users AS U INNER JOIN messages AS M ON U.uid = M.uid_fk INNER JOIN head_networks AS H ON M.network_id=H.network_id LEFT JOIN countries AS C ON M.country_id=C.country_id WHERE M.type='A' ");
$Order = " ORDER BY M.message ASC";
$result = $query . $Order;
while($row=mysql_fetch_array($result))

But it doesnt work. The problem is when i am putting a the variables $Order and $result

3
Contributors
3
Replies
19
Views
3 Years
Discussion Span
Last Post by SimonIoa
1

$query is not a string, it is a mysql_query so your concatenation isn't working as you would think.
Build your string and then create your query.

$select = "SELECT M.msg_id, M.uploads, M.message, M.description, M.type, M.text, M.views_count, U.username, C.name as country_name FROM users AS U INNER JOIN messages AS M ON U.uid = M.uid_fk INNER JOIN head_networks AS H ON M.network_id=H.network_id LEFT JOIN countries AS C ON M.country_id=C.country_id WHERE M.type='A' ";
$Order = " ORDER BY M.message ASC";
$query = mysql_query($select . $Order);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.