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")
{
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

Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

Display last record first.
I need some help how put the last record first and first record last.

Thanks

Code: &am

Escape Latin Characters
I need to escape latin characters in an xml doc. Example: "é" is escaped to "é". I thoug

parameter passing issue on function
Well I thought I had created a pretty slick web page, using ?page and $_GET to load pages which wher

output printing as hexadecmal... XD
Everything works except the calcem call for the totusold and totuprice. The out put shows up as hex.

is_dir() problem
Hello,

I'm buidling a php scripts that dynamically get's subfolders from a specific folder.

Fetching META TAGS through
Hello everybody
I want to fetch meta tags of a domain.
It will be done from following code of

Echo Tweaking help!
HI. I would like to have the output of the entered variables repeat forever, but it's stopping at th

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

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