Jump to content

string concatenation


lc21

Recommended Posts

hmmmm that one could have been logic,  how would this one be fixed?

 

$excel = "SELECT rollN, tyU FROM excel WHERE roll ='". $_SESSION ["roll"]."' AND " rollExcel =".$_SESSION["rollExcel"].";

 

$excel = "SELECT rollN, tyU FROM excel WHERE roll ='". $_SESSION ["roll"]."' AND rollExcel = ".$_SESSION["rollExcel"]."";

Link to comment
https://forums.phpfreaks.com/topic/59750-string-concatenation/#findComment-296998
Share on other sites

my 2cents

 

<?php
$dbs = "SELECT roll, acNumber FROM excelDS WHERE rollAmount ='{$_SESSION['rollAmount']}' AND {$_SESSION['roll']} = '10000'";
?>

 

or to concatenation

 

<?php
$dbs = "SELECT roll, acNumber FROM excelDS WHERE rollAmount ='".$_SESSION['rollAmount']."' AND ".$_SESSION['roll']." = '10000'";
?>

 

Try them.. and let us know:)

Link to comment
https://forums.phpfreaks.com/topic/59750-string-concatenation/#findComment-297157
Share on other sites

also

 

Still get the same error...bad times.

 

It seems to be a problem with the $rollExcel as it has been set to = 1. Should that cause a problem?

 

$rollExcel should be a field name!!

 

BUT it should be

$roll = $_SESSION ["roll"];

NOT

$roll = $_SESSION ['roll"'];

 

fix that problem...

Link to comment
https://forums.phpfreaks.com/topic/59750-string-concatenation/#findComment-297158
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.