Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to keep one variable in memory
Message
 
 
À
25/02/2013 09:09:41
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01566822
Message ID:
01566853
Vues:
33
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform