/    Sign up×
Community /Pin to ProfileBookmark

PHP MySQL – Why am I getting "Query failed: Query was empty"?

Hi,

I have a php page that executes an sql statement. It keeps returning

[quote]

Query2 failed: Query was empty

[/quote]

I have printed the sql out to the webpage and then copied and pasted this directly into MySQL and it works fine.

Does anyone have any ideas what may be wrong with this?

Many Thanks

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMar 11.2005 — Can't tell you anything unless you show some code from connection to sql execution.
Copy linkTweet thisAlerts:
@cowjlauthorMar 11.2005 — Hi - just as i was copying and pasting the code I noticed a typo in my variable name.

Taking a break for lunch obviously improved my vision ?

thanks
Copy linkTweet thisAlerts:
@phpnoviceMar 11.2005 — Cheers.
Copy linkTweet thisAlerts:
@NogDogMar 11.2005 — [i]Originally posted by cowjl [/i]

[B]Hi - just as i was copying and pasting the code I noticed a typo in my variable name.



Taking a break for lunch obviously improved my vision ?



thanks [/B]
[/QUOTE]

LOL - sometimes I wish PHP had something analagous to Perl's "use STRICT;" and "my $variable;" so you'd know right away when you are trying to use an undeclared variable.
×

Success!

Help @cowjl 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...