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

controlling/creating accounts with privileges
hi all,
i'm trying to figure out how i can create/control account with privileges, for instance a

Multiple forms on the same page (safari)
Hello everyone,

I have 3 forms on the same page, that opens in a new window and submits to a

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

Only add new information from XML to MySQL
What I am doing, is taking a xml file, and adding the values to a database. However, what I want to

php - xml what is the best way to do this.
IN essence I want to have a script calling the info from the database.. I have no problem thus far,

Curl & sessions PLS HELP
Hello,

I have a problem with curl and sessions and i will try to explain the best i could.

How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Looking for help on using joining mysql tables and php....
Does anyone have any good links to references on how to pull mysql data, through joining tables and

There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from

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