Mysql function

Started on the old forum in October 2011 · view the original in the archive · old links redirect here

2 replies · 309 views · started 15 years ago · 1 min read

2 participants
jaidon20k Developer · 64 posts #1
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

$text = mysqlf('array', 'select coun(*) from table');

i found that function on adex3g old guest book on his community script

jaidon20k Developer · 64 posts #2

What if i also use 'if() and while()' as function e.g

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

something else Fellow · 2,296 posts #3

injecting php wouldnt work and would be very dangerous if did eg:

<input value="echo $dbpass;"/>

Added after 26 minutes:

although if you really wanted to i guess there would be a work around eg:

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');

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close