0

Practicing some PHP with Databases and I have come across a bit of a problem.

My code for viewing multiple tables and printing is the following and works great.

"SELECT g.id AS golf_id, g.sname AS golf_name, g.start AS start, a.sname AS alpha_name FROM golf AS g, alpha AS a WHERE g.act=a.id) as $a)

However, I am now trying to make it so that I can edit and also insert entries to the tables via the web page.

But I am having trouble getting it to work with my joins and that.

Here is the SQL part.. with what is currently working (only 1 table -no joins)

$sql = 'UPDATE golf SET sname=:sname, start=:start
WHERE id=:id';

Where id=:id is used because when you click on the hyperlink you want to edit, the id code is the page and that's how it knows to edit that specific item.

How would I edit that statement to include the following joins from the first statement?

Appreciate any ideas greatly.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0