Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP Issue

Featured Replies

Hi guysm

 

Basicly, Im trying to retrieve records from the database, only issue is, it misses out the first record and includes the rest...

 

Row 1, Will not display on the website

Row, 2, 3, 4 and so on will.. what am i doing wrong...

 

//GET ALLOWED IPS
$allowed_query = "SELECT * FROM mi5_allowed";
$allowed_run = mysql_query($allowed_query);
$allowed_row = mysql_fetch_assoc($allowed_run);


<?php while(mysql_fetch_assoc($allowed_run)) { ?>
<form action="allowedips.php?action=delete" method="post">
<table class="ipslist_table2">
<tr>
   <td class="ipslist_td2"><?php echo $allowed_row['name']; ?></td>
    <td class="ipslist_td2"><?php echo $allowed_row['ip']; ?></td>
     <td class="ipslist_td2"><?php echo $allowed_row['date']; ?>  <input type="image" src="theme/images/cross.png" border="0" alt="Delete"></td>
   </tr>
   </table>
<input name="ip" value="<?php echo $allowed_row['ip']; ?>" type="hidden" size="15" />
</form>
<?php } ?>

  • Author

remove this line before the while loop

$allowed_row = mysql_fetch_assoc($allowed_run);

 

That doesnt solve it, Now there is no querys showing..

Well it should

Your code now looks like this yeah?

//GET ALLOWED IPS
$allowed_query = "SELECT * FROM mi5_allowed";
$allowed_run = mysql_query($allowed_query);


while(mysql_fetch_assoc($allowed_run)) { ?>
<form action="allowedips.php?action=delete" method="post">
<table class="ipslist_table2">
<tr>
<td class="ipslist_td2"><?php echo $allowed_row['name']; ?></td>
<td class="ipslist_td2"><?php echo $allowed_row['ip']; ?></td>
<td class="ipslist_td2"><?php echo $allowed_row['date']; ?> <input type="image" src="theme/images/cross.png" border="0" alt="Delete"></td>
</tr>
</table>
<input name="ip" value="<?php echo $allowed_row['ip']; ?>" type="hidden" size="15" />
</form>
<?php } ?>

 

Note that you also had a <?php before the while but were actually in php already, so that would have caused a parse error

Did you only paste certain parts of your code? or miss bits?

  • Author

Well it should

Your code now looks like this yeah?

//GET ALLOWED IPS
$allowed_query = "SELECT * FROM mi5_allowed";
$allowed_run = mysql_query($allowed_query);


while(mysql_fetch_assoc($allowed_run)) { ?>
<form action="allowedips.php?action=delete" method="post">
<table class="ipslist_table2">
<tr>
<td class="ipslist_td2"><?php echo $allowed_row['name']; ?></td>
<td class="ipslist_td2"><?php echo $allowed_row['ip']; ?></td>
<td class="ipslist_td2"><?php echo $allowed_row['date']; ?> <input type="image" src="theme/images/cross.png" border="0" alt="Delete"></td>
</tr>
</table>
<input name="ip" value="<?php echo $allowed_row['ip']; ?>" type="hidden" size="15" />
</form>
<?php } ?>

 

Note that you also had a <?php before the while but were actually in php already, so that would have caused a parse error

Did you only paste certain parts of your code? or miss bits?

 

No mate, I was only posting parts of the code the top peace is in <?php tags, i just didnt paste them into the post

ah you needed to add $allowed_row= to the while loop and remove the line I said to remove

The simple fact of the matter is it shouldn't have shown any code if the $allowed_row was not there, so you must have had that there already when you were testing with all but the first row showing

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.