Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to keep one variable in memory
Message
 
 
To
25/02/2013 09:09:41
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01566822
Message ID:
01566853
Views:
34
>Hi Naomi,
>
>I got the solution from TEK-Tips as per your excellent advice by using:
>
>
>$id = 0;
>// Make sure "id" is set and use intval() to makes sure the value is only an integer
>if(isset($_REQUEST['id'])) 
>$id = intval($_REQUEST['id']);
>// Construct your SQL statement now
>$sql = 'SELECT a.ID, c.content FROM article AS a INNER JOIN comment AS c ON a.ID = c.articleID WHERE a.ID = "' . $id . '" GROUP BY a.ID, c.content ORDER BY a.ID DESC LIMIT 5'; 
>
>
>
>Thank you very much,

Great you solved the problem.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform