Closed Thread Icon

Topic awaiting preservation: I just drank a pint and a half a short while ago... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12492" title="Pages that link to Topic awaiting preservation: I just drank a pint and a half a short while ago... (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: I just drank a pint and a half a short while ago... <span class="small">(Page 1 of 1)</span>\

 
Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 10-25-2002 02:02

and maybe my judgement isn't ENTIRELY sound, but...

Does this look alright to you?:

$delete_query = "DELETE FROM requests WHERE cust_id = '" . $delete_from . "' and products_id = '" . $prod_id . "'";
$delete = mysql_query($delete_query);

I can't seem to find anything wrong with it. The page returns no errors, but it isn't deleting from the table. I know that the variables have values, and I know the table is correct. Lastly, I know that the database connection is correct because it is an include and works on all the pages so far. Please help. I'll be chugging another beer down in the meanwhile.

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 10-25-2002 02:32

Sorry, RN -- I just tried your exact code on a test table and it deleted what it needed to.

Try changing your run-query line to this:

$delete = mysql_query($delete_query) or die("Error in query: $delete_query " . mysql_error());

That way, if it screws up, it'll output your SQL statement followed by an error message. Might help you debug.

Side note: by default, in PHP, any variable inside double quotes is expanded. So you can make your code a little cleaner by typing...

$delete_query = "DELETE FROM requests WHERE cust_id = '$delete_from' AND (blah blah blah, etc)"

Even though $delete_from is in single quotes, those single quotes are inside double quotes, and therefore they don't force their contents to be taken literally. Part of the fun of PHP is knowing when double quotes help and when they hurt...

Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 10-25-2002 02:43

Hey, thanks. That helped. products_id was product_id. Would have been too tipsy to notice that without the little error code, thingy.

But your post brings up a question:

what if I wanted to write into a query with and associative array. Say

$query = "SELECT * FROM something or other WHERE customer_id = '$customer_info['customer_id']'";

wouldn't the extra single quotes kind of mess things up? That's why I've built the habit of doing it the other way

customer_id = '" . $customer_info['customer_id'] . "'";

Anyway, thanks for putting in the extra effort to create a table and test it. I really appreciate that.

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 10-25-2002 03:28

Observe my leet PHP-manual-reading skillz...

$query = "SELECT * FROM something or other WHERE customer_id = '{$customer_info['customer_id']}'";

Note the curly braces around your array variable and key. Badabing? Badaboom.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 10-25-2002 03:44

code seems to be well in hand, so...the only thing left to comment on seems to be......

a pint and a half?

I guess it depends on what that pint and a half was of....but since beer is the most common item referred to in pints, I'll have to assume beer.

So.....that begs the question....Tipsy?? Off of a pint and a half???

Maybe you shouldn't be drinking then



Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 10-25-2002 03:54

No, no, sensei, you've got it all wrong -- I get tipsy off a pint and a half myself, if I go through it too quickly, and I consider it a blessing. More drunk for my dollar!

Edit: clicked your sig link, DL... and am I horribly tasteless to think that your "ugliest sig" entry is actually pretty good-looking?

[This message has been edited by Perfect Thunder (edited 10-25-2002).]

Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 10-25-2002 22:19

Actually, your definition of tipsy can range. My definition of tipsy is feeling it at all. But I will tell you 13% beer isn't a joke, and I don't drink for the taste, so I take it down quick. Anyway, I can drink alot, guaranteed. Never lost a contest yet. Beer bong? I can take down two large sized cans of steel reserve (horrible but strong) in 2 seconds. I could sit here and brag all day, but the proof is in the pudding. Who wants to come here and challenge me? Maybe you guys can send Pugzly to check it out since he's local.

Best thing is... I've never gotten hung over... EVER. Don't know why, I just don't.

Thumper
Paranoid (IV) Inmate

From: Deeetroit, MI. USA
Insane since: Mar 2002

posted posted 11-01-2002 00:15

bullshit...

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 11-01-2002 15:42

ooooh, a tough guy. how cool.


Red Ninja
Bipolar (III) Inmate

From: Detroit, MI US
Insane since: Mar 2001

posted posted 11-05-2002 17:56

Ok, Thumper. Just last Friday, remember I was out all night. (Drinking, as it were). Who got up to pick you up at seven in the morning to go to that conference? Who managed to drive for an hour and sit in a chair all day? Who then worked for three hours after we got back at five at night? Could someone do this with a hangover? I think not.

BTW DL, I'm not a tough guy. I don't drink often (once every few months, actually). You said that maybe I shouldn't be drinking. That sounded like man talk to me. An invitation to smack talkin'. I acknowledge drinking doesn't make you a man. However, does not passing out before all the other guys so that you can be the only one to slobber all over the remaining women who have no interest in you make you a man? Rest my case.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 11-05-2002 21:46

uh....ok....I didn't follow about 90% of what you just said there, but - whatever.

It was a joke, not a challenge.

Thumper
Paranoid (IV) Inmate

From: Deeetroit, MI. USA
Insane since: Mar 2002

posted posted 11-06-2002 16:46

<-- did the same thing on Saturday night/Sunday morn...

edit: ...with a hangover.

[This message has been edited by Thumper (edited 11-06-2002).]

norm
Paranoid (IV) Inmate

From: [s]underwater[/s] under-snow in Juneau
Insane since: Sep 2002

posted posted 11-16-2002 19:15

When drinking, it's always a good idea to have a designated-coder, just for safety.

remember: "It's all fun and games, until someone puts an $i out." :-)




when I know everything, will my brain
stop hurting so much when I code?

« BackwardsOnwards »

Show Forum Drop Down Menu