beaglebreath
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: HTML form with submit button won’t got to permalinkI changed all the names of my input fields to unusual names to avoid using someone elses key word, but that also did not fix the isses.
next I added a hidden field:
<input type="hidden" name="page_id" value="167">
and that let the page reload.I do not understand these frustrating time killers.
Forum: Fixing WordPress
In reply to: HTML form with submit button won’t got to permalinkI have restored .htaccess to the code shown above and then changed the permissions to r–r–r–.
the .htaccess is nolonger being overwritten, but this has not fixed my permalinks symptoms.
Forum: Fixing WordPress
In reply to: HTML form with submit button won’t got to permalinkWhile troubleshooting this fiasco, I found the .htaccess file.
I edited the file to include;
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
After saving the file, I confirmed it was updated. I returned to the permalinks settings in my wp-admin, and clicked “save changes”.
Afterward I looked at the .htaccess file, and it had been reverted to the previous contents…Anyone know what might be happening here?
Forum: Developing with WordPress
In reply to: problems with database updateThank you bcworkz and potentdevelopment for your help.
Forum: Developing with WordPress
In reply to: problems with database updateuh no, actually I do have
global $wpdb;
I’ll change that and see what happens.uh yes, actually I am running this from an action hook and I do have a variety other queries around my update query which, if ran, would create new records. Also these insert functions are creating entries in related child tables which are also being generated from the same function.
I think you are correct. My html page has several wpfluent forms on the same page. I have a single action hook function which gets run when any of the submit buttons on any of the forms are clicked. I tried to use an if{}elseif{}else to run only the appropriate query. But if all the forms on the same page are running through my function, (and I’m using the same variable names in each of the different queries) then all the queries for all the forms would be run. …and that would jive with the behavior in my database.
Forum: Developing with WordPress
In reply to: problems with database updateThis update fiasco is inside a function in my functions.php file. at the beginning of the function, I have the following two lines. Am I using these correctly?
global $wpdb; $mydb = new wpdb('user','password1','calibration_data','192.168.1.100');
all of my subsequent sql interactions are through $mydb.
Forum: Developing with WordPress
In reply to: problems with database updateI tried as you suggested above, and did not have any luck.
I tried a few different ideas. I tried using $wpdb->update in the following ways; (the commented lines at the end are my failed attempts.)
if($form->title = 'update_customers') { $myupdatetable = 'customers'; $myupdatedata = array('customers_name'=>$formData['customers_name']); $myupdatewhere = array('customers_id'=>$formData['customers_id']); //$mydb->update($myupdatetable, $myupdatedata, $myupdatewhere, array('%s'), array('%s')); //$mydb->update($myupdatetable, $myupdatedata, $myupdatewhere); //$mydb->update($myupdatetable, $myupdatedata, array('customers_id'=>'1584798494')); }
Each of these attempts creates a new record in my customers table, with a new customers_id (which is also the primary key for the table) as well as updating the customers table record with the correct customers_id.
later I tried the following;
$mydb->query($mydb->prepare("update customers set customers_name = $myupdate_customers_name where customers_id = $myupdate_customers_id"));
but that also created a new record as well as updating.finally I got rid of the variables in the query and tried this;
$mydb->query($mydb->prepare("update customers set customers_name = 'xxx' where customers_id = '1584798494'"));
this query actually worked, but i need to concatenate variables into the query.- This reply was modified 4 years, 6 months ago by beaglebreath.