Jump to content

jones53084

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by jones53084

  1. debug_backtrace() is exactly what I needed. Thank!
  2. Hi! I'm looking for a way to trap postgres errors. I am using the pg_result_error function. It returns the sql error, however it does not return the script and the line number of the error. Neither does the pg_result_error_field function. Is there any way to return a message similar to the pg_execute function?
  3. In my PHP page I do a fetch array to create variables, for use later on in the page.  So i do the fetch array then create a new variable from the result.  Then i use this variable later in the page.  Is this the best way to be doing this?  Is there an easier way?  When I'm finished with my page I'm doing multiple fetch arrays, and have a ton of variables.  Also, I have found that there is a limit to the amount of information i can do in a fetch array.  Does anyone know this limit? 
  4. Hi all, I am writing a contact management php page.  In the page I use mysql_fetch_array() to show the search results.  If the user searchs by first name, there are times when multiple entries come up. Once the data is displayed on the screen the user has the option to edit, or delete this entry in the database.  So on this one screen it shows all the search results.  If the user clicks on edit or delete, I then create a $_SESSION variable to bring this information to the edit or delete page.  However this variable only gets created for the first entry when I do the mysql_fetch_array().  If I choose any entry after the first, it brings over the first entries information.  How would I create a variable to bring this over to another page to edit or delete each specific contact.  Is there a better way to do this?    Thanks!
  5. I am creating a PHP page using a MySQL database.  On my page, I have the user register for the first time, and upon registration it automatically creates a table with their username.  I am running into a problem when the user logs into their account.  The user logs in, and it brings them to a page where they can add new information to their table or can search their table.  Since every user is using a separate table, I am running into trouble when I set the table that specific user is using.  I have no problem if it is a static table name, but when the table name comes from a variable set as: $table = $_REQUEST["user"]; then there is a problem.  Here is more of my code: $table = $_REQUEST["user"]; $result = mysql_query("SELECT * FROM $table Where Name='$name'");while($row = mysql_fetch_array($result)) Then later in the code: $sql = "INSERT INTO $table (name, address, city, state, zip) VALUES ('$name', '$address', '$city', '$state', '$zip')"; This results in an error message: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\Test\add.php on line 54 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(name, address, city, state, zip) VALUES ('l', 'j', 'j', 'j', 'j')' at line 1 The $_REQUEST[“user”] comes from a different page.  This is done on the initial logon screen.  After the username and password is submitted correctly it brings you to a page that asks if you wish to search or add a new record.  Then if you go to the add a new record page(haven’t worked with the search page yet!) this is where the code above is located.  Will using, $table = $_REQUEST["user"];, allow me to access the data from this variable a couple pages deep into my project?  Is this global, so should any page have access to it?  Is there something in MySQL that will not allow a variable such as the one I am calling? Thanks for any help you can provide!!!!!!!!!!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.