mysql query problem (very important for me...)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pedroso
Forum Newbie
Posts: 2
Joined: Sat Jul 23, 2005 4:11 am
Location: Warsaw, Poland

mysql query problem (very important for me...)

Post by pedroso »

Hello!
I'm not a professional programmist, but I create now rather serious project, and -
as You know - sometimes I have problems with php or mysql...
Now I have terribly problem with one mysql query (...) - I need to have
"nr" or "id" in this query, but I can't do it... Everything, what I do - it's always
wrong, incorrect, and - it doesn't work... The part of the script looks like:

//
$question = "select * from data_table where ".$finding_method." like '%".$phrase."%' ORDER BY nr DESC ";
$result = mysql_query($question);
$howmany_founded = mysql_num_rows($result);

echo '<p>The number of fonded elements: '.$howmany_founded.'</p>';

echo " ... etc...
//
So, I need a "nr" or "id" in this query, because I have to make the links
with results of this query, and without a "nr" or "id" it doesn't work correctly,
because it "don't know" which rekord of the data table should be displayed...
I try add something like : "and nr=$nr" ( $question = "select * from data_table where ".$finding_method." like '%".$phrase."%' and nr=$nr ORDER BY nr DESC ";) into query $question, but it still doesn't work...
If You can help me - I thank you very much, if not - I thank you too... bye-bye
Sorry for my english - it isn't my native language, unfortunately - P.P., Warsaw,Poland
dreamline
Forum Contributor
Posts: 158
Joined: Fri May 28, 2004 2:37 am

Post by dreamline »

Didn't i see this in databases either?
Post Reply