Jump to content

Can someone fix my SQL code.


InABoxPr

Recommended Posts

Im not great in SQL, so im not positive on how to fix this code. Im trying to make it select everything instead of just "tasks"

 

so later i can use it like: ect..

 

$fetch = mysql_fetch_assoc($sql);
echo($fetch['TaskID']); 

 

SELECT Tasks.Task as Task from Tasks WHERE Tasks.ID NOT IN (SELECT complete.TaskID FROM complete WHERE complete.UserID = '1'

 

And heres the PHP code im using to execute the sql code.

 

$sql = mysql_query("SELECT Tasks.Task as Task from Tasks WHERE Tasks.ID NOT IN (SELECT complete.TaskID FROM complete WHERE complete.UserID = '1')") or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/239393-can-someone-fix-my-sql-code/
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.