iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-18-2006, 07:39 AM
WebProWorld Member
 
Join Date: Nov 2006
Location: London
Posts: 79
seorocks RepRank 0
Default Displaying records - PHP/MYSQL

Hiya,

I need to write a script in php which checks if the value inserted in the database is higher or lower than a specific number and if the value is higher, it would display a certain statement and if its lower it display another. I am trying to use the script to display 20 figures for each subject and comparing it to the performance of previous month.

thanks,
Claire
Reply With Quote
  #2 (permalink)  
Old 12-22-2006, 09:45 AM
WebProWorld Member
 
Join Date: Mar 2006
Posts: 58
linkstraffic RepRank 0
Default

try something like that:

Code:
$q=mysql_query("SELECT (value > yourvalue) as result FROM yourtable");

while($ql=mysql_fetch_assoc($q))
{
  if($ql['result'])
echo 'sthg';
else echo 'sthgelse';

}
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:31 AM.



Search Engine Optimization by vBSEO 3.3.0