Tuesday 15 September 2015

php - Duplicate dynamic Link -


I have to sign a random Bible quotes which you can search. The citations given on this page are displayed in dynamic link formats, e.g. Bible-query.php? Id = 200

On the search results page, I have placed a link below each page and a link above the page to help users get back to the random display page. These links only problem is dynamically linked, I can only get the top link to display the dynamic link would, under a bus load a page with no quotation marks.

What do I need to display the same dynamic link space below and at the top 'back' link?

Here is the code for search results:

   // New Bible Query section starts defined ('HOSTNAME', 'localhost'); Define ('USERNAME', 'Username'); Define ('password', 'password'); Define ('DATABASE_NAME', 'name'); $ Db = mysql_connect (HOSTNAME, USERNAME, PASSWORD) or die ('I can not connect to MySQL'.); Mysql_select_db (Database_Name); $ Query = "Selection ID, Book, Cap, Poem, RAND () range from row to row 1"; $ Result = mysql_query ($ query); While ($ row = mysql_fetch_array ($ result)) {echo "& LT; center & gt; & lt; a href = '? Baibl- query.php ID = $ row [id]' & gt; to & lt; / A & gt; & lt; / center & gt; "; } // mysql_free_result ($ result); // mysql_close (); // biblical query ends new section ($ data_fetch = mysql_fetch_array ($ query_for_result)) {echo "& lt; li & gt;"; Echo substrust ($ data_fetch [$ db_tb_atr_name2], 0,160), ""; Resonance substrate ($ data_fetch [$ db_tb_atr_name3], 0,160), ""; Echo substroke ($ data_fetch [$ db_tb_atr_name4], 0,160), ""; Resonant substr ($ data_fetch [$ db_tb_atr_name], 0,160); Echo "& lt; / li & gt; & lt; hour / & gt;"; } Echo "& lt; center> gt; & lt; a href = 'bible-query.php id = $ line [id]?' & Gt; Back & lt; / a & gt; & lt; / center & gt; "; Echo "& lt; / ol>; // mysql_close (); ? & Gt; & Lt; / Font & gt; & Lt; / Html & gt;   

Please help!

Line

It runs you the first time using the difficulty Mysql_fetch_array receiving loop, it results And therefore the value of the $ line is set to an array and conditional is "true", so when the loop is run bit. However, there is no other line on the second run-through and therefore the $ line is set to false and when the loop does not run. This means that after the loop the $ line is an empty variable. When that array becomes for the second calling, then it is empty. While removing the loop, only the $ line variable is returned and the first line is returned. All you need is

Just change this bit:.

  while ($ line = mysql_fetch_array ($ result)) {echo "
center> Back gt; & lt; / center & gt; "; }

to:

  $ row = mysql_fetch_array ($ result); Echo "& lt; center & gt; & lt; a href = 'bible-query.php id = $ line [id]?' & Gt; back   

And both parts should work.

No comments:

Post a Comment