indyphp Posted May 11, 2011 Share Posted May 11, 2011 Hello ... I have created a simple html page that has a text box column and a submit like button which is an image. I need to display one column from my table in MySQL database upon submit/click of that image. Searching on the internet i found that we cannot connect to database directly and need to use php script inside html so i have coded it as attached. Also my another requirement is when I am able to retrieve the records I need to display another page with a text "${value from the column in db} Records found in database". Page HTML: //This is the searchable box wherein I need to key in a value// <INPUT ID="Forms Edit Field1" TYPE=TEXT NAME="SearchBx_0" SIZE=26 MAXLENGTH=15 > //This is the image I need to use it to fetch the records from database upon clicking the image// <IMG ID="Picture23" HEIGHT=37 WIDTH=158 SRC="file:///D:/Test/Preview/Autogen/a_butnov.jpg" BORDER=0 ALT="TESTCHK" TITLE="TESTCHK" The php that I have coded is attached which I have embedded inside the tag of image. When I do preview site and click the image it says error on page 'F_doLoaded' undefined Could you please help me in rectifying the code. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/236108-search-in-database-on-clicking-image/ Share on other sites More sharing options...
sunfighter Posted May 14, 2011 Share Posted May 14, 2011 Since you haven't given things that are needed for a complete answer. This will point you in the right direction. Add this between the lines indicated. $result = mysql_query($sql); // between here $HowMany = mysql_num_fields($result); while ($row = mysql_fetch_row($result)){ for($Number = 0; $Number < $HowMany; $Number++) echo "$row[$Number]".'<br />'; } echo " Records found in database."; // And here Link to comment https://forums.phpfreaks.com/topic/236108-search-in-database-on-clicking-image/#findComment-1215425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.