Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7403141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:58:49+00:00 2026-05-29T04:58:49+00:00

I’m ready to pull my hair out… This works perfectly: $link = mysql_connect(‘localhost’, ‘prototype_wp_usr’,

  • 0

I’m ready to pull my hair out…

This works perfectly:

$link = mysql_connect('localhost', 'prototype_wp_usr', 'password') or die("Error: " . mysql_error());
mysql_select_db('prototype_wp');
$query = "INSERT INTO wp_zsession_capture
        (id, session_id, user_login, first_name, last_name, user_email, phone_number, last_conviction)
        VALUES (
            'NULL', 
            '". session_id() ."',
            '". $_POST['user_login'] ."',
            '". $_POST['first_name'] ."',
            '". $_POST['last_name'] ."',
            '". $_POST['user_email'] ."',
            '". $_POST['phone_number'] ."',
            '". $_POST['last_conviction'] ."'
        )";

mysql_query($query) or die ('Error updating database: ' . mysql_error());
mysql_close($link);

This does NOT work:

$link = mysql_connect('localhost', 'prototype_wp_usr', 'password') or die("Error: " . mysql_error());
mysql_select_db('prototype_wp');
$query = "UPDATE wp_zsession_capture SET removed = 1 WHERE session_id = '$sessionid'";

mysql_query($query) or die ('Error updating database: ' . mysql_error());
mysql_close($link);

These two pieces of code are within a form… if there are errors in the form, the FIRST sql query is run to save whatever is in the session at that point. If there are no errors, and after some other stuff goes on, the SECOND sql query is run to UPDATE the ‘removed’ status within those previously saved entries.

I have been tinkering with a million alternative syntaxes and I cannot get those rows to UPDATE. When I execute raw SQL within phpMyAdmin, it works fine. There is nothing logical about this… or maybe I’m just so fantastically tired.

FYI: $sessionid = session_id();

— UPDATE —

I really do appreciate everyone’s concern, but let me address some things:

  1. Yes, there is a column in my table named ‘removed’ … are you serious? 😛
  2. I am of course using session_start();
  3. Yes, I am checking the $sessionid to make sure it is invoked. It’s echoed on the page at all times and is also within any die statements I execute.
  4. The FIRST query is responsible for creating the rows that the SECOND query is supposed to be updating… so the data is there.
  5. mysql_error() does not produce anything … there’s simply no error.

Again, I appreciate your concern, but so far all suggestions have been tried and tried again.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:58:50+00:00Added an answer on May 29, 2026 at 4:58 am

    Use mysql_error() to obtain the error message from the database, like this:

    mysql_query($query) or die ('Error updating database: '.mysql_error());
    

    The error could be one of many things, like for example maybe the user does not have the DELETE permission. If you don’t use mysql_error() there’s no way to know what happened.

    Edit The data in your session_id column looks suspiciously short. Check how long the strings returned by session_id are and check the column length in the database. Inserting data that is too long for a column is not an error but it does crop the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.