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

Module pool selction screen parameters combination logic
Hi floks,
Am new to the module pool development ,Recently i have created one program based on

WELCOME SCREEN
first of all let me tell you what does my script do,

it´s a very simple query to show a e

Unable to display contents in Second Drop Down Box
Hi All,

What I am trying to do is 2 dependent drop down boxes and when user selects su

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

Secure FTP
Hi experts,
There is no SFTP action in MII workbench.
This means it needs developing custo

Need help making login verification cleaner...
I use the below to verify user login. I first check the cookie for the id, ip and a unique id. If it

How do I get the row number from from an sql table query
Hi all

I have a table that I query and it returns a number of rows.
mysql_num_rows($query)

Bit manipulation program with binary operations
My homework is to create a program to scan in and add binary numbers and print them like so

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

Why do I get this error?
Error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or

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