Solved

php mysql look for re sult that = y

Posted on 2013-01-06
1
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 110

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
assigning javascript variable to php variable 8 69
JSON decode 5 46
MySQL 6 48
Prestashop modules custimzation 2 26
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

738 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