Click here to Skip to main content
15,886,806 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: how to implemet a php code on server side? Pin
erroloz28-Jul-12 9:27
erroloz28-Jul-12 9:27 
GeneralRe: how to implemet a php code on server side? Pin
enhzflep28-Jul-12 9:48
enhzflep28-Jul-12 9:48 
GeneralRe: how to implemet a php code on server side? Pin
l a u r e n16-Sep-12 23:09
l a u r e n16-Sep-12 23:09 
AnswerRe: how to implemet a php code on server side? Pin
pragash smile8-Aug-12 4:45
pragash smile8-Aug-12 4:45 
QuestionCan Anybody help me in SMTP for Bulk Emailing Pin
ucsinfotech1220-Jul-12 18:11
ucsinfotech1220-Jul-12 18:11 
AnswerRe: Can Anybody help me in SMTP for Bulk Emailing Pin
Richard MacCutchan20-Jul-12 22:39
mveRichard MacCutchan20-Jul-12 22:39 
SuggestionRe: Can Anybody help me in SMTP for Bulk Emailing Pin
Mohibur Rashid18-Sep-12 15:14
professionalMohibur Rashid18-Sep-12 15:14 
Generalproblem with a query and not sure why... Pin
MacRaider420-Jul-12 7:35
MacRaider420-Jul-12 7:35 
This is the code I'm having a problem with:
PHP
//$sql = "SELECT SQL_CALC_FOUND_ROWS * FROM " . TBL_MEMBERS . " ORDER BY $order LIMIT :startRow, :numRows";
$sql = "SELECT SQL_CALC_FOUND_ROWS * FROM " . TBL_MEMBERS . " ORDER BY $order LIMIT $startRow, $numRows";
				
try {
  $st = $conn->prepare( $sql );
  $st->bindValue( ":startRow", $startRow, PDO::PARAM_INT );
  $st->bindValue( ":numRows", $numRows, PDO::PARAM_INT );
  echo "sql string = " . $sql . "<br />";
  echo "just before we hit the execute<br />";
  $st->execute();
  echo "just hit the execute<br />";
  $members = array();
  foreach ( $st->fetchAll() as $row ) {
    echo "pre";print_r($row);echo "/pre";
    $members[] = new Member( $row );
    echo "pre";print_r($members);echo "/pre";
  }

ok had to remove the <> from the pre tags to makes it easier to read...

Ok, if I run the non-commented out version of the SQL it works fine and I get the result I expect, however if I run the commented out version I get the following error:

Query failed 1: SQLSTATE[42000]: Syntax error or access violation: 1064 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 ''5'' at line 1

I printed this out at the start of the function to check the values:

startRow = 0 and numRows = 5

I'm sure it's something stupid as I only spend about 5 - 10 hours a month doing PHP, so thank you in advance!

oh yeah:

mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.5.24-0ubuntu0.12.04.1 |
+-------------------------+
1 row in set (0.00 sec)

modified 20-Jul-12 13:55pm.

AnswerRe: problem with a query and not sure why... Pin
MacRaider423-Jul-12 8:53
MacRaider423-Jul-12 8:53 
Generalhow to rebind a port in socket programming Pin
desatir731615-Jul-12 2:53
desatir731615-Jul-12 2:53 
GeneralRe: how to rebind a port in socket programming Pin
desatir731617-Jul-12 2:04
desatir731617-Jul-12 2:04 
GeneralRe: how to rebind a port in socket programming Pin
BobJanova17-Jul-12 3:43
BobJanova17-Jul-12 3:43 
GeneralRe: how to rebind a port in socket programming Pin
desatir731617-Jul-12 4:35
desatir731617-Jul-12 4:35 
Generalwhere to start for create a chat system in php? Pin
desatir731612-Jul-12 5:52
desatir731612-Jul-12 5:52 
GeneralRe: where to start for create a chat system in php? Pin
desatir731612-Jul-12 8:16
desatir731612-Jul-12 8:16 
AnswerRe: I found sth Pin
desatir731612-Jul-12 9:01
desatir731612-Jul-12 9:01 
GeneralRe: where to start for create a chat system in php? Pin
AndyInUK13-Jul-12 3:05
AndyInUK13-Jul-12 3:05 
GeneralRe: where to start for create a chat system in php? Pin
BobJanova13-Jul-12 4:53
BobJanova13-Jul-12 4:53 
GeneralRe: where to start for create a chat system in php? Pin
desatir731614-Jul-12 23:35
desatir731614-Jul-12 23:35 
GeneralRe: where to start for create a chat system in php? Pin
enhzflep15-Jul-12 0:07
enhzflep15-Jul-12 0:07 
GeneralRe: where to start for create a chat system in php? Pin
BobJanova17-Jul-12 3:47
BobJanova17-Jul-12 3:47 
QuestionWritng a non-database specific code in PHP Pin
awedaonline11-Jul-12 3:12
awedaonline11-Jul-12 3:12 
AnswerRe: Writng a non-database specific code in PHP Pin
Peter_in_278011-Jul-12 12:30
professionalPeter_in_278011-Jul-12 12:30 
GeneralRe: Writng a non-database specific code in PHP Pin
awedaonline13-Jul-12 4:26
awedaonline13-Jul-12 4:26 
AnswerRe: Writng a non-database specific code in PHP Pin
sali2212-Jul-12 18:13
sali2212-Jul-12 18:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.