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.

Data lost in MySQL table

Featured Replies

I have a page with a big list of stuff. I used a script to enter them all because it would have been a pain to enter everything in HTML with copy & paste. (it’s a lot of DIVs etc and information that has to be changed in-between, so it’s not just a „list“ like I said actually).

 

Anyway, this script used auto_increment.

 

Now I’m not sure why but the last entry of this so-called list (which was the first entry I entered) doesn’t appear on the page anymore. It does appear in the „control panel“ however that I used to enter the data. I can even edit it and submit again but it just won’t appear.

 

I tried going to MySQL and swapping IDs and indeed it does work then, so something seems to be stuck with ID #1 for some reason.

 

I removed auto-increment and hoped I could arrange all stuff the way I wanted but ID #1 is still „blocked“ somehow.

 

Any ideas what this could be?

 

It would be a pain to add everything again. :(

It's hard to tell without any code ,

but aren't you maybe using a loop to print out all the data, which dosen't start on 0 ?

 

Just a guess,

Léon

  • Author

I figured it out! Didn't have anything to do with MySQL, but with the PHP code. I had this here to retrieve the data from the DB:

 

mysql_query('SELECT * FROM site_vehicles ORDER BY id DESC LIMIT 0, 66');

 

I had tried the alter table thing already that's why I was wondering why it didn't work. The "66" was set to 65 by mistake. Which would only allow 65 entries, therefore one missing :)

 

Thanks!

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.