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")
{
Did you know?Explore Trending and Topic pages for more stories like this.
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

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

Can't seem to capture a variable in a chained select
I'm *this* close to having a chained select running but for some reason it doesn't seem to be pickin

Mail functionality from localhost to server
Hi

I am facing problem of mail functionality.

When i tested mail functionality in my

RTF fomatting to email content
Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mai

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

How to insert random unique values in 2 columns ?
I have table with 2 columns

Create Table code_for_code (
first_code varchar2(10) uni

error with opendir
when i do this

if ($handle = opendir($dir)) {
while (false !== ($file = readdir($han

Is there something wrong?
Hi all,

Just a quick question... can someone look at this code and see if something is wrong?

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

Putting double spaces instead of single spaces
Im looking at trying to replace all single spacing between fields with double spacing

At pres

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