FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » MYSQL PHP Query Not Working
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: MYSQL PHP Query Not Working [message #185486 is a reply to message #185484] Thu, 03 April 2014 17:30 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 03/04/14 17:18, Salvatore wrote:
> On 2014-04-03, cuteywithlove(at)gmail(dot)com <cuteywithlove(at)gmail(dot)com> wrote:
>> I've spent hours on this and can't understand why this doesn't work.
>>
>> [snip]
>> $blog_id = filter_input(INPUT_GET, 'blogId', FILTER_SANITIZE_NUMBER_INT);
>> [snip]
>> if (!$stmt->bind_param("ii", $id, $blog_Id)) {
>> [snip]
>>
>> If I copy and paste the query into phpmyadmin and run it with the values
>> hard coded it works.
>>
>> No errors are returned.
>>
>> The user has privileges to delete and everything else.
>>
>> Is there anyway I can check it? or see any errors any other way?
>
> The first thing I see wrong is that you mistyped "$blog_id" as
> "$blog_Id".
>
Mysql may or may not be case sensitive.

He says it works in phpmyadmin

IF its running under apache Id suggests looking at Apache error logs cos
that's typically where errors get reported. There are certainly classes
of errors that don't get reported by the upper layers of the software
that reveal themselves as errors at the base level. A typical one is
trying to process a single result on the implicit assumption that there
is any result at all.


My guess is the statement is executing correctly but not doing anything.

First test: log in as EXACTLY the same user and password under
phpmyadmin and see if it still works.

spent several hours poring over code before I realised that I hadn't
granted select rights on a table to the appropriate mysql user..

In this case does the user have delete rights to the table?

And would that throw and errors at the mysql level? Or simply return a
null result?


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Strange but true! Working with interfaces in PHP
Next Topic: PDF extract text
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 08:43:08 GMT 2024

Total time taken to generate the page: 0.04647 seconds