Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-18-2013, 03:27 AM   PM User | #1
paulocoré
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
paulocoré is an unknown quantity at this point
allow é á etc

I've fixed, for those who had/have the same problem, ill put here the solution for it

Code:
Remove htmlentities at your anti sql injection code
P.S Any idea on how to check multiple data?

i've tryed this, but no success

Code:
$q = mysql_query("SELECT notes FROM banip,unbanip,logs ORDER BY date DESC LIMIT 0,7");
if (mysql_num_rows($q) < 1 )

Last edited by paulocoré; 01-18-2013 at 05:03 AM..
paulocoré is offline   Reply With Quote
Old 01-18-2013, 03:57 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
That would also throw if I were to enter something such as O'Reily, so I think you'll need to re-evaluate what you are doing for detection.
Until PHP 6 which is when I hope we get it, PHP is not multibyte native. You can make use of multibyte functionality with the mb_* functions; however, I do not believe there exists an mb_strcmp function. You can write one though. Probably a check against the length of both, and if they match you can then use something like the mb_substr_count to see if it counts 1.

PCRE is classified as multibyte safe as well if you use the 'u' modifier, so you should be able to do comparisons using preg_match as well.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
paulocoré (01-18-2013)
Old 01-18-2013, 04:59 AM   PM User | #3
paulocoré
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
paulocoré is an unknown quantity at this point
I found out, removing HTML Entities, will let you write é á on form.


Any idea on how to check multiple data ?

i've tryed this, but i had no success.

Code:
$q = mysql_query("SELECT notes FROM banip,unbanip,logs ORDER BY date DESC LIMIT 0,7");
if (mysql_num_rows($q) < 1 )

Last edited by paulocoré; 01-18-2013 at 05:03 AM..
paulocoré is offline   Reply With Quote
Old 01-18-2013, 06:46 AM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I don't understand what you mean by multiple. Do you mean in your query? That query would result in the newest 7 entries assuming the date is a DateTime or derivative type in mysql (ie not a string).
If you need to show it, than you need to iterate it with a while loop and mysql_fetch_assoc or mysql_fetch_row.
See the link in my signature as well. The mysql library will disappear soon and so you should replace it with mysqli or pdo.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:33 PM.


Advertisement
Log in to turn off these ads.