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.

SQL Update Issues

Featured Replies

Hey everyone,

 

On my CMS that I am writing, I am trying to edit a page using PHP and MySQL, however, when I submit the changes, nothing gets updated in the DB.

 

I tried to do a bit of checking and made it print out the SQL statement instead of processing it, this is what I got:

UPDATE pages SET page_name = 'testpage 222', page_desc = 'thisistestpage', page_content = '
Test Page 2

This is another test to see that everything is working!

' WHERE page_id = '3'

 

It seems okay to me, this is what is annoying me though, because I have done this so many times, yet this is the first time I have had a problem.

 

If anyone could point me in the right direction that would be really cool :)

 

Thanks

Is it not because you are trying to insert the html straight into the DB?

 

You should use mysql_real_escape_string() and maybe htmlencode() to filter what's being put into theDB.

  • Author
Is it not because you are trying to insert the html straight into the DB?

 

You should use mysql_real_escape_string() and maybe htmlencode() to filter what's being put into theDB.

 

I tried putting them in aswell, but it is still not updating.

 

This is turning into quite the beard scratcher over here :(

 

BIG BAD EDIT:

I turned mysql_error reporting on and this is what I got back:

 

Unknown column 'page_name' in 'field list'

Can you check your spellings in the database compared to the query? That error sounds like there is a typo somewhere.

  • Author

Its official, I feel stupid :(

 

Checked the database again, and instead of page_name it should of been page_title

 

Thanks for the help anyway Jmz :)

I think that sort of thing happens to everyone now and again :p

I think that sort of thing happens to everyone now and again :p

 

Yeah, I have done it several times.

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.