|
-- Posted by yoshiness at 3:10 pm on Mar. 21, 2008
This is what I'm trying to do : When a user clicks on an image, PHP script to insert a value into a field in MySQL table for a row that ALREADY exists... Much like a shopping cart for a specific user... Basically, what I tried earlier was reading information from a cookie, but what happened in return, is it created 2 new NULL users... :/ Help?
-- Posted by allsmiles at 5:45 pm on Mar. 21, 2008
Any chance you can rephrase that? Are you having problems with an update query?
-- Posted by yoshiness at 8:01 pm on Mar. 21, 2008
Okay. When a user clicks on an image, I want PHP to be able to identify the ID/name of that image depending which name/ID I gave it. Then, I want PHP to insert the image ID/name into a certain spot in a MySQL table for only a certain username. To get the username listed in the MySQL table, it should analyze the cookie containing the username, then match it to a username in the database, and insert it into a certain spot, depending which spot is available. As I stated before, it should be sorta like an online shopping cart. /The name/id thing in the image I was talking about : " " I'm not so good with PHP programming. I am trying to learn as I go, so that I don't have to keep coming here so often, and spamming the place up.
-- Posted by allsmiles at 6:52 am on Mar. 22, 2008
Let's presume that the name of the image is defined by the variable $object, and the username is referenced by an id $_COOKIE['ID']. The certain spot in the table can be a record in the table `userImageClick` made unique by the user's ID. On the page that the image links to (presumably something like imageclick.php?id=$object), the code should simply be something like: | Code: | $sql = mysql_query("UPDATE `userImageClick` set `imageID` = '$_GET[id]' WHERE `userID` = '$_COOKIE[ID]' LIMIT 0,1") or die('Query failed.'); | I get the feeling that I've misunderstood what you want to happen though...
-- Posted by yoshiness at 4:53 pm on Mar. 23, 2008
I still need some help... I need some in-depth details... Like... How to use the coding for one??? :P I also don't want to use a prebuilt custom CMS... That only makes things more difficult :) Here's a flash on what I'm trying to do... http://img227.imageshack.us/my.php?image=examplegx3.swf Basically, this is the function I'm using : print" " ?> How would I do what I showed you in the Flash movie?
-- Posted by allsmiles at 4:57 pm on Mar. 23, 2008
Okay... I'm gonna PM you.
|