I have a function I made called updateAvailability()
in this same php file, it shows the user "yes" if something is available and "no" if something isn't
i want them to be able to click the yes or no and have it call updateAvailability()
how do i do this?
i tried onClick, but it didn't work
the file is edit_my_properties.php
the function is called updateAvailability()
thanks
Calling a function in php
Moderator: General Moderators
php is executed server-side, onClick is a client-side event-handler.
Between two requests there is no connection server<->client.
Have a read of viewtopic.php?t=1030
Between two requests there is no connection server<->client.
Have a read of viewtopic.php?t=1030
-
Nicholasp27
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 31, 2003 6:29 pm
How do you get the info of the articles in the first place? If you load a page (say items.php) that shows you the status of items, a linkNicholasp27 wrote: basically, i just want the click to run a simple update query to the mysql db and then reload the page
how do i do this in php?
Code: Select all
<a href="items.php">Reload</a>-
Nicholasp27
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 31, 2003 6:29 pm
i do a select query to get the value in the field "active"
it scrolls through every item to get their value and display them in a table
i want the user to be able to click the value (yes or no) and then it will run an update query to change it to the other value
i would like to have it run the query and refresh the same page
if i have to, i can have the link go to a new page, passing the item ID, and the new page can run the query for that item ID, but I'd rather not
in either case, how could i do this?
it scrolls through every item to get their value and display them in a table
i want the user to be able to click the value (yes or no) and then it will run an update query to change it to the other value
i would like to have it run the query and refresh the same page
if i have to, i can have the link go to a new page, passing the item ID, and the new page can run the query for that item ID, but I'd rather not
in either case, how could i do this?
-
Nicholasp27
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 31, 2003 6:29 pm