I'm getting following messages in my browser:
What is causing them?Code:Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/omeragic/public_html/rebus/test/index.php on line 38 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/omeragic/public_html/rebus/test/index.php on line 40
That error is due to an invalid query being supplied.
Thanks, excellent article. Learned quite a lot.
I am glad you liked it.![]()
thanks for the clear tutorial
Instant of using the function array_map can't you use the foreach function?
Like this:
Or is it better without get_magic_quotes_gpc()?Code:foreach($_GET as $key => $value){
if(get_magic_quotes_gpc()){
$_GET[$key] = stripslashes($value);
$_GET[$key] = mysql_real_escape_string($value);
}else{
$_GET[$key] = stripslashes($value);
$_GET[$key] = mysql_real_escape_string($value);
}
}
Code:foreach($_GET as $key => $value){
$_GET[$key] = stripslashes($value);
$_GET[$key] = mysql_real_escape_string($value);
}
@fyhring4: You can use foreach, but array_map relies on slightly more internal principles, atleast in development less code is often better, especially if it is more efficient. Your code makes not very much sense though, you may wish to wrap that reusable code in a function.
Be sure to read the updated FAQ || Health is achieved through 10,000 different steps.
A textual description can be only part of your question, be sure to provide sample results, errors and your platform in the appropriate forums while asking.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks