hammerslane
12-15-2003, 04:00 AM
hey folks.
this question is mainly to do with mysql syntax, all help /slight feedback is appreciated
i'm basically trying to delete a chosen record from a database.
there's a while loop on index.php which shows all records in a table.
in the while loop, below every row of data, there's a DELETE and EDIT option like this:
Job Title job1
Pay Rate pay1
Shift Pattern shift1
Qualifications qual1
Location loca1
Description des1
edit | delete
Job Title job2
Pay Rate pay2
Shift Pattern shift2
Qualifications qual2
Location loc2
Description desc2
edit | delete
etc, etc
when you click delete, it should go to another page and display that particular record and ask for a confirmation for the delete
the thing is, i want to pass the $jobtitle variable (with the value of 'job2' for example), over to the next page.
i thought that defining the variable at the beginning of the while loop would work, like this,$jobtitle=$row["jobtitle"];for all the variables, so that i'd have all the relevant variables defined, so i could use them in the WHERE jobtitle='$jobtitle' in the sql statement on the final delete page.
the problem is, i can't figure out how to get the variable defined.
is $jobtitle=$row["jobtitle"]; the right way to define a variable with database info?
i don't know if i'm doing this the right way, so any comments/slaps are more than welcome :cool:
thanks
this question is mainly to do with mysql syntax, all help /slight feedback is appreciated
i'm basically trying to delete a chosen record from a database.
there's a while loop on index.php which shows all records in a table.
in the while loop, below every row of data, there's a DELETE and EDIT option like this:
Job Title job1
Pay Rate pay1
Shift Pattern shift1
Qualifications qual1
Location loca1
Description des1
edit | delete
Job Title job2
Pay Rate pay2
Shift Pattern shift2
Qualifications qual2
Location loc2
Description desc2
edit | delete
etc, etc
when you click delete, it should go to another page and display that particular record and ask for a confirmation for the delete
the thing is, i want to pass the $jobtitle variable (with the value of 'job2' for example), over to the next page.
i thought that defining the variable at the beginning of the while loop would work, like this,$jobtitle=$row["jobtitle"];for all the variables, so that i'd have all the relevant variables defined, so i could use them in the WHERE jobtitle='$jobtitle' in the sql statement on the final delete page.
the problem is, i can't figure out how to get the variable defined.
is $jobtitle=$row["jobtitle"]; the right way to define a variable with database info?
i don't know if i'm doing this the right way, so any comments/slaps are more than welcome :cool:
thanks