Mysql function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mysql function

    PHP Code:
    function mysqlf($type$string)
    {
    if(
    $type =='query')
    {
    $lol mysql_query("$string");
    return 
    $lol;
    } elseif(
    $type =='array')
    {
    $lol mysql_fetch_array("$string");
    return 
    $lol;
    } else {
    echo 
    " error type not exist in function. Olajide Adeyemi a.k.a adex3g";
    }

    usage
    PHP Code:
    $text mysqlf('array''select coun(*) from table'); 
    i found that function on adex3g old guest book on his community script

    #2
    What if i also use 'if() and while()' as function
    e.g
    [php]
    function jaidonif($call)
    {
    $rq = if($call);
    return $rq;
    }
    to use/call the function

    jaidonif(isset($_GET['my'])
    {
    echo "yes to done.";
    } else{
    echo 'error';
    }
    can all those above functions work. Thank

    Comment


      #3
      injecting php wouldnt work and would be very dangerous if did
      eg:
      PHP Code:
      <input value="echo $dbpass;"/> 
      Added after 26 minutes:

      although if you really wanted to i guess there would be a work around eg:
      PHP Code:
      function jaidonif($var1,$math,$var2,$trueString,$falseString)
      {
          if(
      $math=='==')
          {
             if(
      $var1==$var2
               return 
      $trueString;
              else
               return 
      $falseString;
          }
           else if(
      $math=='!=')
          {
              if(
      $var1!=$var2
                return 
      $trueString;
              else
                return 
      $falseString;

          }
      //add more else if`s here
      }

       echo 
      jaidonif('Hello','!=','World','Hello isnt equal to the world','I think this server is screwed up'); 
      Last edited by something else; 19.10.11, 00:55.

      Comment

      Working...
      X