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 #185487 is a reply to message #185486] Thu, 03 April 2014 18:38 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 4/3/2014 1:30 PM, The Natural Philosopher wrote:
> 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?
>
>

Your guess is wrong. And it has nothing to do with whether MySQL is
case-sensitive or not. $blog_Id is a PHP variable.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[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: Sun Nov 24 01:01:22 GMT 2024

Total time taken to generate the page: 0.04098 seconds