php - iteration within a while loop -


Sorry for asking twice, but the second was closed because this important information was lost and I'm sorry Although my code is sought:

  if (isset ($ _GET ['id'])) // // connect to MySQL database "connect.php" is included; $ Id = preg_replace ('# [^ 0-9] #' ',' ', $ _GET [' id ']); // Check this var to see if this ID exists, if so, get the bioinformatics $ sql = mysql_query ("SELECT * FROM bio \ n". "Add Left Bio_Media \ n". "ON BIO. Id = bio_media .bioid \ n "." Where BOAD = ". $ Id" \ n "." \ N "." LIMIT 0, 30 "); // Get all bio details ($ row = mysql_fetch_array ($ sql)) {$ name = $ row ["name"]; $ Age = $ row ["age"]; $ Partition = $ line ["partition"]; $ Pic = $ row ["pic"]; $ Story = $ line ["story"]; $ FB = $ line ["FB"]; $ Tw = $ line ["tw"]; $ Type = $ line ['type']; $ File = $ line ['file']; $ Alt = $ line ['alt']; $ Headline = $ line ['title']; $ Age = determine ezframodob ($ age); While ($ type == "image") {$ images. = '& Lt; A rel = "lb [pp_gal]" href = "image / '.$ file.'" & Gt; & Lt; Img width = "60px" alt = "'. $ Alt.'" Title = "'. $ Title.'" Src = "image / '.$ file." "$ I = -1; if ($ type ==" video ") {$ i ++; $ video. = '& Lt; li & gt; & lt; / li & gt; & lt; li & Gt; & lt; a href = "watch.php? Id = '. $ Id '& Amp; V = '. $ File. '& Amp; Ref = '. $ I. '? Iframe = True & amp; Width = 745 & amp; Height = 520 "rel =" lb "heading =" ' $ Alt. ' "$ Headline." & Lt; / a & gt; & lt; / li & gt; ';}   

Question: To re-update the +1 for each entry in the database, I am referring to the URL "Ref" How do I get the part?

If I understand you correctly, you will get a $ I = -1; will get rid of the loop and just $ I = 0; before the loop.

Anyway, if you loop your variable every time Overwriting in either; Or just add $ line to an array and using that Do not use the temporary variable at all and is directly needed where use $ row .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -