Jump to content

mysqli_query Help!


pundabuyer

Recommended Posts

Hi All,

 

Wondering if anyone could help with my issus. I have written some SQL below to get a bit of data out of the database but having strange results. I have requested all data from all tables with 2 simple left joins. The tables and data types are fine and all match and the query runs. but when i output the results all i get is the full 'requests' table and no associated data from the other tables. There is definately data that corresponds in the other 2. also i get the entire requests table even if i only request one field from it... whats going on!

 

"SELECT requests.*, users.*, areas.* FROM (requests LEFT JOIN users ON requests.requesterID = users.userid) LEFT JOIN areas ON requests.areaID = areas.areaID"

 

thanks in advance, A

Link to comment
Share on other sites

SELECT requests.*, users.*, areas.* FROM requests 
LEFT JOIN users ON requests.requesterID = users.userid 
LEFT JOIN areas ON requests.areaID = areas.areaID

try that, you had brackets in there which weren't needed

Edited by DarkKnight2011
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.