Pass PHP Variable into WHERE/AND MySQL Query -



Pass PHP Variable into WHERE/AND MySQL Query -

i'm trying pass value query takes in variable before sql query , compares result against field table. can't seem figure out syntax.

$topname = $row_rsadmindetails['fullname'] ; $testquerytwo = "select * participants, admin admin.over_id = participants.fk_over_id , participants.dr_over_names '%$topname%'"; $testresult2 = mysql_query($testquerytwo) or die(mysql_error());

the php output i'm looking do:

<?php // print out contents of each row while($row_testresulttwo = mysql_fetch_array($testresulttwo)){ echo $row_testresulttwo['username']. " - ". $row_testresulttwo['participant_name']; echo "<br />"; } ?>

problem on line:

while($row_testresulttwo = mysql_fetch_array($testresulttwo)){

should

while($row_testresulttwo = mysql_fetch_array($testresult2)){ // have no $testresulttwo variable... }

and seek query ... like '%".$topname."%'"

php mysql

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -