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

present value of sequence?
Hi

Please help me to find out the present value of sequence?

Thanks

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

Help with file_get_html
The following code gives the expected results:

<html>
<head&g

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

Help uploading .JPG
I have a problem with upload images when the ending is .JPG capitalized.. I really don't know what c

Strange php code found on my website
I got hacked and the following code was placed within my files:

Code: [Select]<?
/*

fwrite error
Hi All,
Does anyone know what is causing the error in this code?

Code: <?
$error

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

redirect standard error and assert (how to?)
How do you redirect standard error and assert?

---

(Why? I am creating an web app and

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