Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once 'config.php';
- $username = @$_GET['user'];
- $password = @$_GET['password'];
- $message_from = @$_GET['from'];
- $message_to = @$_GET['to'];
- if(($login = login($username, $password)) != 1) {
- echo $login; // return the value of the error
- exit;
- } else {
- $mysql = mysql_query("SELECT * FROM messages WHERE from LIKE $message_from AND to LIKE $message_to ORDER BY time ASC LIMIT 50");
- $rows = @mysql_numrows($mysql);
- echo 'MySQL Error: ' . mysql_error().'<br/>';
- if($rows > 0) {
- $i = 0;
- while($i < $rows) {
- $result_content = mysql_result($mysql, $i, 'content');
- $result_from = mysql_result($mysql, $i, 'from');
- echo $result_from.'<br/>'.$result_content.'<br/><br/>';
- $i++;
- }
- } else {
- echo 'No messages.';
- }
- }
- ?>
- MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from LIKE 8 AND to LIKE 1 ORDER BY time ASC LIMIT 50' at line 1
- $rows = mysql_numrows($mysql);
- SELECT * FROM messages WHERE from=`8` AND to=`1` ORDER BY time ASC LIMIT 50
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement