mysql select with $_get ?


Posted on 16th Feb 2014 07:03 pm by admin

Hi, i have this code:
Code: // If char id is 0 and character dont exist do:
if ($_GET["id"] == "0")
{
Did you know?Explore Trending and Topic pages for more stories like this.
die "A character ID can never be 0. This character does not exists or have not been created yet!
Please create a new character first.";
}
else

// Get the character stats from the wc_characters table
$charinfo = mysql_query("SELECT CharacterId, class, points, level, xp, reqxp, money, str, agi, inte, sta, backs, chests, feet, hands, helmets, legs, necks, wrists, leftweapons, rightweapons, waists, tinkers, shoulders, rings, profession1, profession2, playerId, hp, mn, armor, dps, rank FROM wc_characters WHERE CharacterId ='$_SESSION[valid_user]'")
or die(mysql_error());
Now for my where clause, i want the ID = the ID the user inputs in the URL, like here:
if ($_GET["id"] == "0")
So if a user gets to a url like ?id=1 it should select where characterid = 1
No comments posted yet

Your Answer:

Login to answer
115 Like 17 Dislike
Previous forums Next forums
Other forums

Error in query: Resource id #4??
hey guys, having a minor (i think) problem here that i havent been able to figure out. long story sh

Upload simple problem
Really confused!! I run once and it worked, but when i tried today...it didn't work

Which par

Google voice
I currently have a form in html, but I want it in php so the information is not in the source code.<

single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag w

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

Fetching array then reversing it
Hi, I have a simple problem, I'll try to explain it as best I can:
News entries in my database ar

Check Date/Time in PHP
What I need the code to check is that $reQuest is 24 hours in the past then return a time based on h

Saving data from a form into a file
Hey everybody,

Sorry, I am really new to PHP coding and such but a project kind of got thrust

extract a file from zip file
hi,
i know how to unzip a zip file in php, but is there a way to just extract a certain file only

Display Database
I need to create a shopping cart. I found this code online: http://conceptlogic.com/jcart/
Unfort

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash