REMOVED.

Heaplink

Developer & Designer
Nov 9, 2011
510
173
First off, use MySQLi or PDO instead of the old mysql functions (they're deprecated in newer versions of PHP).

To find 'reply' in a string you can do something like

Code:
$postTitle = "Reply: Hello World";

if (strpos($postTitle, 'reply') !== false) {
    // Do something if reply is in string.
}

However, that would cause an issue if a title was something like "Please reply this" or similar.

I would make a reply table or column that takes an ID that it replies to instead.
 

Heaplink

Developer & Designer
Nov 9, 2011
510
173
But if you're going to learn MySQL anyway start at a point where you don't use old functions.

You should NEVER rely on string data. I could change the hidden field anyway I wan't and submit it (even with malicious code, which MySQL can't escape - read about XSS). Therefore you should use IDs to get what topic/post it replies for.
 

ButtLord420

Please delete my devbest account.
Dec 11, 2010
463
32
But if you're going to learn MySQL anyway start at a point where you don't use old functions.

You should NEVER rely on string data. I could change the hidden field anyway I wan't and submit it (even with malicious code, which MySQL can't escape - read about XSS). Therefore you should use IDs to get what topic/post it replies for.
In this case it woulden't matter if the person changed the title, but the other data in their it might... Do you have skype?
 

Ecko

23:37 [autobots] -!- eckostylez [[email protected]]
Nov 25, 2012
1,398
962
$query_posts = sprintf("SELECT * FROM posts WHERE forumid = %s" AND WHERE title != 'reply', GetSQLValueString($colname_posts, "int"));

If that doesn't work, try replacing != with NOT LIKE
 

Users who are viewing this thread

Top