LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 692 users online 221682 members 1123 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
eklipse
Music: Classical, Acoustic, Alternative, Tranc...
Mood: Musical
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
3 online / 61 MPM
Fresh Topics
  LiveWire / Technical Forums / Web Design & Search Engine Optimization / Viewing Topic

Need some help...
PHP MySQL help again
Replies: 5Last Post Mar. 23, 2008 4:57pm by allsmiles
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( yoshiness )


Enlightened One

Patron
Reply
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?

-------
"Last night I tried to slip it in her rear. When she began to
complain about the pain, I stupidly told her to take it like a man."

~Quantumleaper


3:10 pm on Mar. 21, 2008 | Joined: Dec. 2007 | Days Active: 503
Join to learn more about yoshiness Texas, United States | Straight Male | Posts: 7,900 | Points: 14,596
LiveWire Humor
allsmiles


Enlightened One

Patron
Reply
Any chance you can rephrase that? Are you having problems with an update query?

-------
When they leave me, they're all smiles.
When they leave you, they're in tears.

5:45 pm on Mar. 21, 2008 | Joined: Aug. 2007 | Days Active: 565
Join to learn more about allsmiles England, United Kingdom | Male | Posts: 8,802 | Points: 15,777
( yoshiness )


Enlightened One

Patron
Reply
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 :

"<img src='...' width=123 height=456 name=object id=object>"

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.

Post edited at 8:05 pm on Mar. 21, 2008 by yoshiness

-------
"Last night I tried to slip it in her rear. When she began to
complain about the pain, I stupidly told her to take it like a man."

~Quantumleaper


8:01 pm on Mar. 21, 2008 | Joined: Dec. 2007 | Days Active: 503
Join to learn more about yoshiness Texas, United States | Straight Male | Posts: 7,900 | Points: 14,596
allsmiles


Enlightened One

Patron
Reply
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...

-------
When they leave me, they're all smiles.
When they leave you, they're in tears.


6:52 am on Mar. 22, 2008 | Joined: Aug. 2007 | Days Active: 565
Join to learn more about allsmiles England, United Kingdom | Male | Posts: 8,802 | Points: 15,777
( yoshiness )


Enlightened One

Patron
Reply
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 :

<?php

print"<img id='Picture' src='./picture.gif'>"

?>

How would I do what I showed you in the Flash movie?

-------
"Last night I tried to slip it in her rear. When she began to
complain about the pain, I stupidly told her to take it like a man."

~Quantumleaper


4:53 pm on Mar. 23, 2008 | Joined: Dec. 2007 | Days Active: 503
Join to learn more about yoshiness Texas, United States | Straight Male | Posts: 7,900 | Points: 14,596
allsmiles


Enlightened One

Patron
Reply
Okay... I'm gonna PM you.

-------
When they leave me, they're all smiles.
When they leave you, they're in tears.

4:57 pm on Mar. 23, 2008 | Joined: Aug. 2007 | Days Active: 565
Join to learn more about allsmiles England, United Kingdom | Male | Posts: 8,802 | Points: 15,777
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Web Design & Search Engine Optimization / Viewing Topic