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
17
Other forums
Help on query replacing the date
Hi Pals,
i want to replace the current date in a column to some value say C or D or any n
Mysterious Timeouts
I've deployed a few simple AJAX-enabled web page to a local server that is accessed through the Inte
first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see
Why use interfaces in PHP (OOP)
I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't unders
Checking BOM Authorization Group
Hai Friends,
I have developed a mulitilevel BOM display report. End users have been assig