I try to create a code which detect un-matching input,
Code: Select all
<?php
// Connects to your Database
mysql_connect("localhost", "root", "password") or die(mysql_error());
mysql_select_db("hospital") or die(mysql_error());
if ($_REQUEST[iwant]){
$id = $_COOKIE['ID_my_site'];
$result = mysql_query("SELECT title FROM pix WHERE pid ='$id'");
while($list = mysql_fetch_array($result)) {
if([color=#FF0040]$_REQUEST[iwant] != $list['title'] [/color]) {die ('<br><center><font color=red>NO SUCH IMAGES FOR THIS PARTICULAR PATIENT</font><br>Please Enter the correct title that had been assigned to this patient only</center>');}
}}THE PROBLEM IS :
when it comes to this part if($_REQUEST[iwant] != $list['title'] ) , my all codes are working well if there is only ONE title inside my pix table. BUT when i stored more than one title inside my pix table...the IF code suddenly DIE with message. It seems it couldn't work with more than one title stored.....i thought when i used mysql_fetch_array i could fetch all my data....
Did I Do Anything Wrong??
Help me Please
Thanks!
Azhan
_________________________
http://www.productcoverdesign.com-"Cheapest E-Cover Design"