If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

can populate a select list from a database but can't update it to a field

Hi,

I have a select list that is populated from a table and shows all the names of pages in the select list. Trouble is when I press update it doesn't update the selected page to a field. Can anyone advise please?

Is this a copy and paste error? You have two identical functions here; good thing they're wrapped in a function_exists check or it would throw fatal. Remove the one since its not required.

Do you receive an error when you issue an update? I'm not 100% sure if you can issue it with a joined table without using identified tablespaces, but I'm sure it would complain if there were ambiguity.
If you do not have an error from the sql, remove the header call and place a printf("Updated %d records.", mysql_affected_rows($design_online_connection)); to see how many records were updated. If its 0 AND the data is actually different for at least one record to change, than the where clause is incorrect.

Also, with the work you have here you probably should upgrade to mysqli or PDO libraries. The mysql is deprecated and will be removed in the nearish future. Using either of the above let you prepare your statements, so they will be similar to what you are doing already without all the extra code.

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)