Jump to content

Help Updating MySQL database tables


flashbangpro

Recommended Posts

Seriously at this point I'm starting to think you're trolling.

 

You set the fields to blank values. Of course they are blank. What did you expect?

 

I realize you may not want to help me anymore and I understand I can be frustrating not knowing all that you know, Thank you for the help you have given.

Link to comment
Share on other sites

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I have just realized that the INSERT clause apparently doesn't take a WHERE so I have switched back to UPDATE and this is the error I recieved

 

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 '' at line 5

 

Error: 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 '' at line 5 SQL: UPDATE service_info SET `date_next_maint`='testing', `date_reported`='testing', `scheduled_service_date`='testing', `service_performed`='', `date_service_performed`='testing', `date_of_followup`='',`service_in_progress`='', `date_return_use`='', `time_return_use`='', `issues_nonrepairable`='', `date_nonrepairable_issues`='', `comments` ='' WHERE id=

Link to comment
Share on other sites

The single-quotes you just added didn't fix anything. They are hiding the fact that $id is empty in the query. You shouldn't have quotes around numerical data values inside of a query anyway. You still must find out why the $id variable doesn't have a value in it (you shouldn't even be running the query if there's no $id.)

Link to comment
Share on other sites

You have put the error_reporting/display_errors settings at the end of your code. How could that help with errors that occur when your code runs? Those two settings would need to be put before the session_start() statement. You should actually have those two values set in your master php.ini so that you don't need to put them into your code and you don't need to remember to remove them when you put your code onto a live server. Having them in your master php.ini will also report and display fatal parse/syntax errors in your main file.

Link to comment
Share on other sites

Ok I will move them above session start and added print $query and this is what I got....

 

Notice: Undefined index: id in /data/9/0/28/4/517493/user/528148/htdocs/jednewdb/updated_maint.php on line 9

 

Notice: Undefined index: service_in_progress in /data/9/0/28/4/517493/user/528148/htdocs/jednewdb/updated_maint.php on line 16

UPDATE service_info SET `date_next_maint`='8/23/12', `date_reported`='8/20/12', `scheduled_service_date`='8/20/12', `service_performed`='', `date_service_performed`='8/20/12', `date_of_followup`='',`service_in_progress`='', `date_return_use`='8/24/12', `time_return_use`='23:00', `issues_nonrepairable`='', `date_nonrepairable_issues`='testing', `comments` ='' WHERE id=''

 

I don't understand how it isn't defined when it is the correct id on the maint_update page

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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.