Jump to content

uha666

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

uha666's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=383316:date=Jun 13 2006, 10:22 AM:name=radalin)--][div class=\'quotetop\']QUOTE(radalin @ Jun 13 2006, 10:22 AM) [snapback]383316[/snapback][/div][div class=\'quotemain\'][!--quotec--] What is the thing that works ok? I didn't get it because you mean that everything is fine with the code at other parts but there is problem with this one? So it's more then a variable problem than a syntax or anything else problem. Because syntax errors returns errors. put an echo command for your qeury just before sending them to the db. You will probably remark that a variable is missing somewhere. Probably you will see: SELECT `data` FROM `char` WHERE `name`='' but I'm not very sure. [/quote] I just want to know what's the correct syntax to use a function inside a query so i can compare the return value of that function with the value 1.
  2. Don't mind the function cause that's working fine. I'm using php cause this is part of a website so i need it to be displayed in a browser. my only problem is that i must have some error in the way i do the query cause it never returns values from the function, i think i might have the syntax wrong. =/
  3. I have a simples code a wanted to implement that as been giving me some headaches I have this query: $result=mysql_query(" select * from char where ". getStat('name') ." = 1 "); < (char and name are table names) > In wich i'm trying to call out this function: function getStat($pname){ $query = "SELECT `data` FROM `char` WHERE `name`='$pname'"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); $pdata = mysql_fetch_array($result); $pinfo = explode(" ", $pdata[0]); return $pinfo[34]; } The function works perfect in other sections of my site. I just can't seem to get the correct syntax on the query so that it does the compare with the value 1 correctly. Each time i run the query it never returns any valid rows although there are some. Is it because i do a function with a query inside another query? Is there any way i can make this work? Thanks in advance. =/
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.