[Gllug] Another PHP Question

Jackson, Harry HJackson at colt-telecom.com
Wed Jul 11 14:29:41 UTC 2001


Hi all

	This little piece of code is causing me some problems. When I click
Enter Information I get the correct data and all variables Ok however when I
Click it again it comes back saying that all the variables in my SQL
statement are undeclared. For every time I press Enter Information it will
be good, bad, good, bad, good, bad. Can someone please shed some light on
this because it is slowly but surely doing my head in. 


<html>
<body>


<a href=second.php>(For SPR Numbers and Remedy Cases Click here)</a><br><br>

<a href=help.php>(HELP Click here)</a><br>

<h2>Auto Wildcards are being used for the following Query:</h2>

  <form method="post" action="<?php echo $PHP_SELF?>">

 	WHERE	:	<SELECT NAME="var1">
			<OPTION value = CASEID>CASEID
			<OPTION value = Arrived>Arrived
			<OPTION value = Type>Type
			<OPTION value = Name>name
			<OPTION value = Short>Short
			<OPTION value = Details>Details
			<OPTION value = WorkLog>WorkLog
			<OPTION value = Individual>Individual      /* 20 */
			<OPTION value = Status>Status
			<OPTION value = Pending>Pending                
			</SELECT>
	
        IS LIKE	:	<input type="Text" name="var2">

	AND	:	<SELECT NAME="var3">
			<OPTION value = CASEID>CASEID
			<OPTION value = Arrived>Arrived
			<OPTION value = Type>Type
			<OPTION value = Name>Name
			<OPTION value = Short>Short
			<OPTION value = Details>Details
			<OPTION value = WorkLog>WorkLog
			<OPTION value = Individual>Individual
			<OPTION value = Status>Status
			<OPTION value = Pending>Pending
			</SELECT>					

	IS	:	<SELECT NAME="var4">
			<OPTION value = LIKE>LIKE
			<OPTION value = "NOT LIKE">NOT LIKE
			</SELECT>


			:<input type="Text" name="var5">



  <input type="Submit" name="submit" value="Enter information">

  </form>

<?php


$db = mysql_connect("localhost");

mysql_select_db("remedy_harry",$db);


$caseid = mysql_query("SELECT * FROM remedy_base where $var1 Like '%$var2%'
and $var3 $var4 '%$var5%'",$db);


 printf("<h1><b> The following is a list of Case ID's for Remedy:
</b></h1><br><table border=1>");


 while ($myrow = mysql_fetch_row($caseid)) {

 printf( "<tr><td>%s</td>  <td>%s</td>
	      <td>%s</td>  <td>%s</td>
   	      <td>%s</td>  <td>%s</td>
   	      <td>%s</td>  <td>%s</td>
    	      <td>%s</td>  <td>%s</td>
 	 </tr>"
    	  , $myrow[0],  $myrow[1]
    	  , $myrow[2],  $myrow[3]
    	  , $myrow[4],  $myrow[5]
   	  , $myrow[6],  $myrow[7]
   	  , $myrow[7],  $myrow[8]
   	  , $myrow[9]
 );

}
 echo "</table>\n";



?>

</body>

</html>

Regards;
Harry Jackson.


     



**********************************************************************
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. 020 7390 3900

This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or 
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message.  Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.


**********************************************************************

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list