Solved

php mysql look for re sult that = y

Posted on 2013-01-06
1
149 Views
Last Modified: 2013-01-11
the code below is work but i want to change not limit 1   in case  presell.stockcut is y such as they have 10 row but they have 1 row that
presell.stockcut = y

then go to    


 if($checkstockcut == "y") {
      echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS1.php/\" />\n";
      }




  $query20 = "SELECT presell.stockcut  FROM presell WHERE refid = '$invoicenocheck' limit 1 ";
      $query20result  = mysql_query ($query20) or die( mysql_error());
      $row_slelectPresell = mysql_fetch_assoc($query20result );
      $checkstockcut = $row_slelectPresell['stockcut'];
      echo $checkstockcut;
          if($checkstockcut == "y") {
      echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS1.php/\" />\n";
      }
      else {

0
Comment
Question by:teera
1 Comment
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 38748510
Something like this uses the while() iterator to get multiple rows.

$query20 = "SELECT presell.stockcut  FROM presell WHERE refid = '$invoicenocheck' limit 10 ";
$query20result  = mysql_query ($query20) or die( mysql_error());
while ($row_slelectPresell = mysql_fetch_assoc($query20result ))
{
      $checkstockcut = $row_slelectPresell['stockcut'];
      echo $checkstockcut;
      if($checkstockcut == "y") 
      {
          echo "<meta http-equiv=\"refresh\" content=\"0;url=presalefromS1.php/\" />\n";
      }
      else { ...
}

Open in new window

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now