vestaviascott
11-02-2009, 10:47 PM
Hi, I'm new here so please take it easy on me with this first post :-)
What I need to do is to create a script that will reside in my theme's functions.php file that either automatically executes when the file is loaded or on a button click and updates the db as follows...
update wp_options set uploads_use_yearmonth_folders = 0;
update wp_options set permalink_structure = '/%postname%/';
Can someone help me with the script?
In classic asp, I would use something like this...
sql = update wp_options set uploads_use_yearmonth_folders = 0
sql2 = update wp_options set permalink_structure = '/%postname%/'
set rs = conn.execute(sql)
set rs2 = conn.execute(sql2)
rs.close
rs2.close
where "conn" is the open db connection
What is the PHP equivalent?
I'm working in wordpress 2.8.5 (also, do I have a connection object when in functions.php or do I need to create one?
What I need to do is to create a script that will reside in my theme's functions.php file that either automatically executes when the file is loaded or on a button click and updates the db as follows...
update wp_options set uploads_use_yearmonth_folders = 0;
update wp_options set permalink_structure = '/%postname%/';
Can someone help me with the script?
In classic asp, I would use something like this...
sql = update wp_options set uploads_use_yearmonth_folders = 0
sql2 = update wp_options set permalink_structure = '/%postname%/'
set rs = conn.execute(sql)
set rs2 = conn.execute(sql2)
rs.close
rs2.close
where "conn" is the open db connection
What is the PHP equivalent?
I'm working in wordpress 2.8.5 (also, do I have a connection object when in functions.php or do I need to create one?