Jump to content

[SOLVED] Quick question... quick reply would be VERY appreciated


Ghettobusta

Recommended Posts

I am using the POST method like this:

<?php
echo "Subject value -> " . $_POST['sujet'] . "<br/>";
?>

 

And then I use this in a MySQL request:

$requete='SELECT Ctexte, Cdate, Unom FROM Commentaires, Usagers WHERE Commentaires.CUid = Usagers.Uid AND Commentaires.CSid = '.$_POST['sujet'];

 

I am getting this error message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"' at line 1

 

What is not right in my syntax?

Thx in advance!

$requete="SELECT `Ctexte`,`Cdate`, `Unom` FROM `Commentaires`, `Usagers` WHERE Commentaires.CUid = Usagers.Uid AND Commentaires.CSid = '".$_POST['sujet']."'";

 

quatation is needed when you have string comparision Commentaires.csid = 'maths'

I tried both your methods... and both times I got a blank page (I get this often for little mistakes like quotation marks... it's getting on my nerves since I am not an experienced PHP programmer)

 

Thanks for the quick replies... any other idea??

Here, go to:

http://cogito.labos.polymtl.ca/~ti317/TS2/index.php

 

Choose a subject (any of them) and click "envoyer"

 

On the next page, you can see "Subject value -> 2167"" displayed at the very top of the page.

I do not want to display this... is there a way to hide it?

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.