
July 27th, 1999, 02:45 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
I'm not too clear on the details of what you're asking, but the script might look something like this.
First we need to define the query we'll be using:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?
mysql_connect($mysqlServer,$mysqlUser,$mysqlPassword);
mysql_select_db($mysqlDB);
if($student_id){$searchResult=mysql_query("select * from tableName where student_id='$student_id'");}
elseif($name){$searchResult=mysql_query("select * from tableName where name like '%$name%'");}
elseif($address){$searchResult=mysql_query("select * from ...
?>
[/quote]
Then you need to read the information out:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?
while($student=mysql_fetch_array($searchResult)){
echo "ID: $student[student_id]<br>";
echo "Name: $student[name]<br>";
echo "Address: $student[address]<br>";
echo "Faculty: $student[faculty]<br><br>";
}
?>
[/quote]
That may not be exactly what you want, but I hope it helps....
|