addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [php-49] Do i have PDO?

From: Mark S.
Sent on: Sunday, July 31, 2016, 11:09 AM
I noticed you misspelled categories in your code .... Is it misspelled in the db too?

On Sat, Jul 30, 2016 at 9:54 PM max steinmetz <[address removed]> wrote:
Thanks Mark - i tried that but the same result is still returned and it only happens when trying to do a delete. create update insert all work.

This is very confusing to me.


On Jul 30, 2016, at 9:50 PM, Mark Steudel <[address removed]> wrote:

Try changing their names to lower case and see if it works. Ive run into issues before where case got me into trouble.
On Sat, Jul 30, 2016 at 9:49 PM max steinmetz <[address removed]> wrote:
I’ve checked and my db does exist and the table does exist and the column name is spelt correctly.

I can run this statement in my admin program (DELETE FROM `ma_Categories` WHERE CatID = 12) and it works. If i try to execute it with my function it fails as i’ve detailed.

I’m very stumped. Everything exists and is spelt correctly - i’ve noticed that the error message lists the db name as ‘matest’ and ‘ma_catagories’ and their actually MAtest and ma_Catagories

I am stumped.
Thanks for any help




On Jul 30, 2016, at 9:39 PM, Mark Steudel <[address removed]> wrote:

The error means it cant find the table ma_categories in the db matest. Check for misspellings or that the table really exists in the database you are using.
On Sat, Jul 30, 2016 at 9:08 PM max steinmetz <[address removed]> wrote:
So i’ve an error and i’m not sure how to resolve it as the error seems to be indicating that the table/db doesn’t exist. I’ve checked and it does and i’ve spelt it correctly in the sql statement which i’ve prepared. 

This is the error message:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matest.ma_catagories' doesn't exist' in /Applications/AMPPS/www/WrDK/threads/index.php on line 1370
( ! ) PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matest.ma_catagories' doesn't exist in /Applications/AMPPS/www/WrDK/threads/index.php on line 1370
Call Stack
#TimeMemoryFunctionLocation
10.0018287296{main}( )../index.php:0
20.0063598216categoryRemove( )../index.php:230
30.0065598728prepare ( )../index.php:1370


This is the function i’ve built that is calling the error:
function categoryRemove(){
#If user is logged - allow edit else send back to timeline
if(startSession() && isset($_SESSION['UserID']))
{
$CatID = strip_tags($_GET['id']);  #int - primaryKey

$db = pdo(); # pdo() creates and returns a PDO object
#dumpDie($_POST);

$sql = "DELETE FROM ma_Catagories WHERE `CatID` = :CatID";

#dumpDie($CatID); ID exists

$stmt = $db->prepare($sql);
//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);
$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);

try {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}
#feedback success or failure of update

if ($stmt->rowCount() > 0)
{//success!  provide feedback, chance to change another!
feedback("Category Removed Successfully","success");
}else{//Problem!  Provide feedback!
feedback("Category Not Trashed!","warning");
}
myRedirect(THIS_PAGE);
}
#script for expanding textarea
}


I’ve done all i can to troubleshoot this and i’ve not been able to resolve it. very stumped.
Thanks for any help as always.

cheers




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Meetup on behalf of max steinmetz from Seattle PHP User Group.
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Meetup on behalf of Mark Steudel from Seattle PHP User Group.
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Meetup on behalf of max steinmetz from Seattle PHP User Group.
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Meetup on behalf of Mark Steudel from Seattle PHP User Group.
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Meetup on behalf of max steinmetz from Seattle PHP User Group.
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

People in this
group are also in: