php nested while loop. Inner loop works only once [closed]

Try This: <?php //connect to the database $con=mysql_connect(“localhost”,”root”,””) or die(“Error in connection”); mysql_select_db(“riffadb”,$con)or die(“Error in database”); // $sql1 =”select category_id,category_code from category”; $res1 = mysql_query($sql1); $i=0; $j=1000; while($row1 = mysql_fetch_array($res1)) { echo $row1[‘category_code’]; echo ‘<br/>’; // execute second query under the first loop $sql2 = “select category_id1,product_id from product”; $res2 = mysql_query($sql2); while($row2 = mysql_fetch_array($res2)) … Read more

Why is set.timeout not working in this php while loop?

You cannot really use the setTimeout() function as you suggest… I guess this is roughly what you are looking for: echo <<< EOT <script type=”text/javascript”> setTimeout(function() { window.open(‘https://mywebsite/$link’, ‘_blank’); }, 1000); </script> EOT; Note: I just use the nowdoc notation since it is easier to read. Certainly it is possible to use a normal literal … Read more

Lowercase letters that did not appear in the array, in order [closed]

We, beginners, should help each other. If the function deals with strings then the second parameter of the function is redundant. A straightforward approach without using standard containers as for example std::set can look the following way #include <iostream> void missing( const char s[] ) { const char *letter = “abcdefghijklmnopqrstuvwxyz”; for ( size_t i … Read more