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

Linux, Apache, MySQL, PHP

 
GeneralRe: learn php Pin
Wamuti27-Sep-12 5:08
Wamuti27-Sep-12 5:08 
JokeRe: learn php Pin
User 171649227-Sep-12 5:18
professionalUser 171649227-Sep-12 5:18 
GeneralRe: learn php Pin
Andrei Straut19-Sep-12 3:12
Andrei Straut19-Sep-12 3:12 
GeneralRe: learn php PinPopular
Richard MacCutchan19-Sep-12 3:53
mveRichard MacCutchan19-Sep-12 3:53 
GeneralRe: learn php Pin
Stephan A.19-Sep-12 6:59
Stephan A.19-Sep-12 6:59 
GeneralRe: learn php Pin
Richard MacCutchan19-Sep-12 8:22
mveRichard MacCutchan19-Sep-12 8:22 
GeneralRe: learn php Pin
crayben12-Nov-12 22:44
crayben12-Nov-12 22:44 
AnswerRe: learn php PinPopular
Mohibur Rashid18-Sep-12 15:08
professionalMohibur Rashid18-Sep-12 15:08 
AnswerRe: learn php Pin
Wamuti27-Sep-12 5:11
Wamuti27-Sep-12 5:11 
GeneralRe: learn php Pin
Richard MacCutchan27-Sep-12 5:41
mveRichard MacCutchan27-Sep-12 5:41 
AnswerRe: learn php Pin
Thomas Daniels5-Oct-12 5:40
mentorThomas Daniels5-Oct-12 5:40 
Questionhow to implemet a php code on server side? Pin
erroloz28-Jul-12 8:21
erroloz28-Jul-12 8:21 
AnswerRe: how to implemet a php code on server side? Pin
enhzflep28-Jul-12 8:32
enhzflep28-Jul-12 8:32 
GeneralRe: how to implemet a php code on server side? Pin
erroloz28-Jul-12 8:37
erroloz28-Jul-12 8:37 
GeneralRe: how to implemet a php code on server side? Pin
enhzflep28-Jul-12 8:49
enhzflep28-Jul-12 8:49 
GeneralRe: how to implemet a php code on server side? Pin
erroloz28-Jul-12 8:58
erroloz28-Jul-12 8:58 
GeneralRe: how to implemet a php code on server side? Pin
enhzflep28-Jul-12 9:17
enhzflep28-Jul-12 9:17 
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.

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.