Sandbox

Where you can play with regular chat features (except flagging...
Tom
Mar 17, 2013 20:54
nm...
Tom
Mar 17, 2013 20:53
I've got a question about binery
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Tom
Mar 14, 2013 15:58
You could pay me to sign a marriage license. I'll do it for about $18K (US)
Tom
Mar 14, 2013 15:57
You could always get married to a woman or man for immigration.
Tom
Mar 14, 2013 15:47
Build apps, make things. That's how you get work.
Tom
Mar 14, 2013 15:46
Places will hire you based on your portfolio. Nobody gives a shit about a resume. Old school, corporate companies.
Tom
Mar 14, 2013 15:45
Credentials mean nothing if you have a stellar portfolio and you know how to work with people well, witha good personality.
Tom
Mar 14, 2013 15:42
Anyone know why my mysql_connect is saying NO password only when it's outside of public_html and at the root my my server?
 
Tom
Feb 15, 2013 22:25
=D
Tom
Feb 15, 2013 22:23
oh yeah, you got it
Tom
Feb 15, 2013 22:22
thank you so much
Tom
Feb 15, 2013 22:22
I want to give you lots of stackoverflow karma
Tom
Feb 15, 2013 22:21
I'm literally just learning all of this today... I can't tell you how much I appreciate all of the help
Tom
Feb 15, 2013 22:20
ah new stuff gotcha I can probably google it
Tom
Feb 15, 2013 22:19
so why does it come out as "Resource id #3"?
Tom
Feb 15, 2013 22:19
ah makes sense
Tom
Feb 15, 2013 22:15
by the way, SELECT height FROM table ORDER BY id DESC LIMIT 1 came up as: "Resource id #3"
Tom
Feb 15, 2013 22:14
but since the ID are incrementing, I don't know how to read the 5th row and display it. Does that make sense?
Tom
Feb 15, 2013 22:13
=)
Tom
Feb 15, 2013 22:13
To give you the context of what I'm doing. I'm scraping wave height from a buoy in the ocean every hour from a cron job that I just wrote. Where only the latest 5 readings are kept. Now I'd like to read the latest height that was inserted in.
Tom
Feb 15, 2013 22:08
I want to display the 5th row's height
Tom
Feb 15, 2013 22:06
so I got that, but since I'm reading it by the ID, how would I display the height from that?
Tom
Feb 15, 2013 22:05
now how would I select the 5th row, from height?
Tom
Feb 15, 2013 22:05
This is what I have so far:

`
$rand = rand(1,10);

mysql_query("INSERT INTO wave_data (height) VALUES ($rand)");

mysql_query("DELETE FROM wave_data ORDER BY id ASC LIMIT 1");
`
Tom
Feb 15, 2013 22:05
Is it bad for the ID to increment really far? If so, I would think it would be wise to just keep it to ID 1 through 5. New data is inserted at 5. ID 1 data is delete, and everything shifts down ID's.
Tom
Feb 15, 2013 22:05
id = 1. So I'd always keep a history of 4 after the newly inserted data. And I'm not even sure what ID's are... or why I'd want to increment them or reset them... so this is who you're dealing with =D
Tom
Feb 15, 2013 22:05
I think I'm confused or thinking about this in the wrong way. I basically just need to insert in new data but only hold up to 5 entries. like the picture I had. Every time you insert in new data the last one will be deleted, and so on. I just thought you'd want to not increment the ID's every time you did. I'm so new to this...
Tom
Feb 15, 2013 22:05
Now how do I reset the ID increments?