









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] PHP/MySQL scripts
- Subject: [NMLUG] PHP/MySQL scripts
- From: nmlug@swcp.com (Tim Price)
- Date: 23 Oct 2000 07:16:30 -0600
I am inserting a new row. The data in this case is from a new entry to a timesheet so I have to insert a new row. I have already pulled data from two different tables, staff and projects, and that data plus the additional data entered by the user on the timesheet form will make up a new row in a third table, the employee's timesheet table. There is a separate table in the database for each employee named "ts###" with the #s being the employee's ID number. That is the reason I am using a variable for the table name in the php script.
Of course, I will use UPDATE for any editing or changes to entries already completed in the timesheets. But there's another set of scripts for those options.
My predicament is that I don't know if the problem is that I'm not defining variables correctly, the order of the SQL commands are wrong, the syntax concerning quotation marks are not correct, a combination of those problems or something else altogether.
Sarang brings up a good point about the quotation marks. I have found that going from an html document and calling a php script to INSERT INTO or UPDATE a MySQL table requires the same MySQL syntax concerning use of quotation marks as a batch file or using the command line; however, when you call a php script from a php script the rules change concerning the use of quotation marks on files, table names and field names. This is an area that I have found confusing; and I have not found the documentation to be particularly clear as to how, when and why I need to use single or double quotation marks or no quotation marks to execute MySQL commands in php scripts.
On Friday, December 8, 1939, Jude Gabaldon <jude@photon.unm.edu> wrote:
>Tim,
> I took a quick look at the code and I might have missed something
>important. But, are you looking the insert a whole new row or just UPDATE
>the exisiting row. The syntax for UPDATE is (and this is just off the top
>of my head so it could be wrong) "UPDATE table_name
>'column_name'=$column_value where employee_id=$employee_id". Just a
>thought.
>
>Jude
>
>
>------------------------------------------------------
>To UNSUBSCRIBE send a message to nmlug-request@swcp.com
>with only the word unsubscribe in the body. More
>information can be found at www.nmlug.org/info.html
>-----------------------------------------------------
>
>
>
------------------------------------------------------
To UNSUBSCRIBE send a message to nmlug-request@swcp.com
with only the word unsubscribe in the body. More
information can be found at www.nmlug.org/info.html
-----------------------------------------------------
|
|