Time for some thrilling heroics.

Jayne ,'The Train Job'


Buffistechnology 3: "Press Some Buttons, See What Happens."

Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!


amych - May 21, 2008 9:36:18 am PDT #6296 of 25501
Now let us crush something soft and watch it fountain blood. That is a girlish thing to want to do, yes?

Gud has it right -- you click in the timeline to set your cursor, and click/drag to highlight the parts you want to cut in the same way you'd highlight what you want to cut out in a word document. It's just that the interface can be a little fiddly (and waveforms a little strange if you're unfamiliar with them) if there isn't either a screenshot or someone there to help out. A lot of people have troube with it until they get used to what they're seeing.


Jon B. - May 21, 2008 9:57:27 am PDT #6297 of 25501
A turkey in every toilet -- only in America!

Anyone know php associative arrays? I've got a small two column mySQL table that i want to stuff into an associative array. The fields in the table are program_id and program_name. I want the array to have it's keys equal to the program_id and the values equal to the program_name.

Here's my code. The query in the first three lines is definitely working correctly, but I include it for completeness. I think the problem is in how I am assigning elements to the array, but I don't know the correct syntax. Help?

$query = "SELECT * FROM tbl_programs";
$query .= " ORDER BY program_name";
$progquery=mysql_query($query);

While ($progArr = mysql_fetch_assoc($progquery)) { $progTable[] = $progArr['program_id']=>$progArr['program_name']; }


§ ita § - May 21, 2008 10:37:26 am PDT #6298 of 25501
Well not canonically, no, but this is transformative fiction.

What do you want the resulting array to look like? I'd probably have the assignment in the loop look like

$progTable[$progArr['program_id']]=$progTable[$progArr['program_name']];

In terms of learning what I've just done to arrays, I do a lot of print_r($array) so that I can see what got put where, and how I can get it out again. It's very powerful, but damn it's easy to slip something in and not know how to get it back out.


Jon B. - May 21, 2008 10:42:56 am PDT #6299 of 25501
A turkey in every toilet -- only in America!

$progTable['program_id']=$progTable['program_name'];

Ahhh, yeah, I think that should work! Thanks. I knew I just needed another pair of eyes. Now if my server would only stop acting up, I could test this...


§ ita § - May 21, 2008 10:47:23 am PDT #6300 of 25501
Well not canonically, no, but this is transformative fiction.

No! That's not going to work! I'm such a ditz. Let me fix it...gimme a couple seconds, though, because work calls.


§ ita § - May 21, 2008 10:51:07 am PDT #6301 of 25501
Well not canonically, no, but this is transformative fiction.

Here you go: I neglected to actually put anything from the query result in there, in my rushedness:

$progTable[$progArr['program_id']]=$progTable[$progArr['program_name']];


Gudanov - May 21, 2008 10:51:33 am PDT #6302 of 25501
Coding and Sleeping

Wouldn't it be?

$progTable[$progArr['program_id']]=$progArr['program_name'];

My PHP is rusty though, I don't use it very much.


Jon B. - May 21, 2008 10:54:23 am PDT #6303 of 25501
A turkey in every toilet -- only in America!

I'm also a ditz for not immediately noticing the error! I think Gud's got it.


Jon B. - May 21, 2008 10:59:57 am PDT #6304 of 25501
A turkey in every toilet -- only in America!

Yep. It's working how I want it. Thanks guys!


§ ita § - May 21, 2008 11:16:59 am PDT #6305 of 25501
Well not canonically, no, but this is transformative fiction.

It's a wonder this board works at all.

I need to keep my fixings asymmetrical.

Or stop trying to work.