/    Sign up×
Community /Pin to ProfileBookmark

Concentation Problem

I am trying to figure it out for lot of hours now to no avail. When I use the mysql for query it show the result, but when I tried it to run it at php, it does not show a result.

Code1

[code=php] $sql=”SELECT * FROM infotest where (status=2 or status=3) and tt_ID=”.$ap_id. ” “;

$sid3=’40152′;

$sql .= ” and school_ID='”.$sid3.”‘”;[/code]

I am missing a space or something in my sql? How about the code below, Am I missing a space or something in my sql?

Code 2

[code=php] $sql=”SELECT * FROM infotest where (status=2 or status=3) and tt_ID=”.$ap_id. ” “;

foreach($sid as $sid2)
{

$sql_concat .=” or school_ID=”.$sid2.””;
}

$sid3=’40152′;

$sql .= ” and (school_ID='”.$sid3.”‘”;
$sql .=$sql_concat.”)”;

[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NvenomJul 13.2011 — Code1
[code=php]
$sql="SELECT * FROM infotest WHERE (status = '2' OR status = '3') AND tt_ID = '$ap_id' AND school_ID = '40152'";
// Might be an error in this still lol im exausted :)
[/code]


Dont even feel as though i can bother with Code2. Would help if you posted the error your getting more often than not its one tiny little thing. Also echoing any variables that seem suspicious.
×

Success!

Help @anishgiri spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...