Solved

php mysql look for re sult that = y

Posted on 2013-01-06
1
150 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Creating and Managing Databases with phpMyAdmin in cPanel.
The viewer will learn how to dynamically set the form action using jQuery.
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 …

914 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

17 Experts available now in Live!

Get 1:1 Help Now