Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mysql_info [2010-12-10 10:42]
Joakim Forsgren
mysql_info [2017-09-01 14:54] (current)
Line 10: Line 10:
 $query = "​SELECT *  $query = "​SELECT * 
 FROM `lab5_Threads` LEFT JOIN `lab5_Items` USING(ThreadID) ​ FROM `lab5_Threads` LEFT JOIN `lab5_Items` USING(ThreadID) ​
-WHERE ThreadID = '"​ . $_POST['​ThreadID'​] . "'​ AND (lab5_Threads.UserID = '"​ . service_session::​getInstance()->​Get('​UserID'​) . "'​ OR " . service_session::​getInstance()->​Get('​Admin'​) . "​)";​+WHERE ThreadID = '"​ . $_POST['​ThreadID'​] . "'​ AND  
 +(lab5_Threads.UserID = '"​ . service_session::​getInstance()->​Get('​UserID'​) . "'​ OR " . service_session::​getInstance()->​Get('​Admin'​) . "​)";​
  
 #Sen gör man enkelt om det till en delete #Sen gör man enkelt om det till en delete
 $query = "​DELETE lab5_Threads,​ lab5_Items ​ $query = "​DELETE lab5_Threads,​ lab5_Items ​
 FROM `lab5_Threads` LEFT JOIN `lab5_Items` USING(ThreadID) ​ FROM `lab5_Threads` LEFT JOIN `lab5_Items` USING(ThreadID) ​
-WHERE ThreadID = '"​ . $_POST['​ThreadID'​] . "'​ AND (lab5_Threads.UserID = '"​ . service_session::​getInstance()->​Get('​UserID'​) . "'​ OR " . service_session::​getInstance()->​Get('​Admin'​) . "​)";​+WHERE ThreadID = '"​ . $_POST['​ThreadID'​] . "'​ AND  
 +(lab5_Threads.UserID = '"​ . service_session::​getInstance()->​Get('​UserID'​) . "'​ OR " . service_session::​getInstance()->​Get('​Admin'​) . "​)";​
  
 #OBSERVERA att det bara är rad 1 som jag behöver ändra för att göra om en SELECT till en DELETE #OBSERVERA att det bara är rad 1 som jag behöver ändra för att göra om en SELECT till en DELETE
  
 </​code>​ </​code>​