Extracting from a Database using PHP / Flash

Thanks to all for the great resource created here . . .
OK, I’m new to flash & trying to learn PHP as well.
How difficult is it to have a small MYSql Database & draw info from it using PHP (I assume this is the most efficient method). Also, How is the book Foundation PHP for Flash for any of you who may have read it. Also, does Kirupa have an amazon referal link so I can throw him a few pennies with my book purchases? If it’s not too hard a very basic commented example would be cool to see. I haven’t seen to many posting on dynamically driven (database) sites & wanted to get the brains talking.

Thanks to all,
Tim

What’s up! If you are new to both PHP AND Flash, you might have some difficulty. However, if you have an advanced programming background, it might not be too hard for you to figure things out. At any rate, I’m pretty comfortable with Flash and getting things started with PHP. I’m getting comfortable with using both together. I haven’t tried database manipulation but I’m sure it shouldn’t be too big a step if you’re already familiar with PHP and Flash. Recently I purchased Server-Side Flash: Scripts, Databases, and Dynamic Development. So far it has been very useful and easy to understand!

How comfortable are you with Actionscript?

I have a couple of scripts that I’ll post for you in the morning.

I admittedly still have some problems with this myself, but I’ll be happy to share what I know so far. As far as I’m concerned it’s a fairly easy process as these things go.

Hey Renni Girl…how much did that book set you back? I’m broke but I need to learn more. I am going to start putting together a site for myself, and i want to learn as much as possible. Any good books on ASP and PHP? Any one give me some suggestions? This is going to be my summer project.

I’m a complete retard and can’t understand a lot of the books out there on PHP/MySql etc. I have bought other ones before (those Peach Pit Press Quickstart guides) - but again, I got frustrated and put the books away forever. But this book was easy to understand for me but I can see that someone more advanced might find it simplistic. I like it because it makes the codes easy to understand by comparing them to Actionscript (which I do understand).

At any rate, it’s quite pricey - (I paid $40). I have been going to the bookstore to read it regularly for a while now, I thought it was time to stop smooching of the bookstore and finally buy it. If it’s too much for you right now, I recommend smoching off the bookstore - or at least check it out next time you’re at the bookstore.

I just checked my universities libraries and they have a few pHP and ASP books that i’m going to check out before i purchase anything. thanks renngirl

Thanks for all the quick responses kids. I’m ok with action script which is to say I’m new to the game but seem to understand the tutorials & what not. I did stumble across a book which seems to be pretty good for PHP. You can find it @ www.sitepoint.com. You can read the 1st 4 chapters online which is what I did. Think I’ll be plunking down the cash there. PHP to me anyway seems to be a fantasic way to go. I appreciate it & look forward any helpful posting.

Take care,
Tim

I’m working on a mock XML database right now and I, too will be using PHP. I will likely also be posting for help soon.

The book that I have is the same one as Rena, and I love it. Very informative.

php is like any other language, it takes some getting used to, but it’s a lot like Flash action script too, so if you’re into that, you’ll have an easier time with php than a complete newbie.

My only complaint about the book is that it leaves out a really important hint that is provided in “Flash Developer’s guide”

the include statement.

PHP will allow you to have all of your information, like server name, database name, user name, and password, stored in a different location than the php script that is doing the action. This allows you to set a small php file in a folder that is inaccessable without a password, but which contains the password and such for the connection. I’m still looking for a working script that I can post here. Ignore the stuff below… I’m just testing to see if ezboard will let me post php stuff directly in these posts.
If you can see the below, I’ll let you know that this is a simple php script which can be used to create tables in a database.

<?php
$server=“localhost”;
$user=“upuaut”;
$pass=“nuggets”;
$flashbase=“centerspindb”;
$table=“guestbook”;
$hookup=mysql_connect($server,$user,$pass);
$debase=mysql_select_db($flashbase,$hookup);
$sql="CREATE TABLE $table (ename char(30), email char(40));
$result=@mysql_query($sql,$hookup);
if($result){
echo “Table has been created”;
}
?>

looks like all it does is cut out the first tag which is

?php with a “less than” symbol in front of it.

I do have PHP for Flash, and liked it a lot, i was completely new to php, and it’s really not too hard once you get the basics. The companion site (www.phpforflash.com) lets you download all the sourcefiles (even the message board…hint, renniegirl!) and the forum there is ok, the author even answers mails almost the same day and wrote a chapter in foED “Flash 5 dynamic content studio”, which covers some cool stuff like javascript talking to swfs, php, asp, …and comes with a cd (1200 pages!), but…goes for $60!

Also bought sams php in 24 hours, which is ok too, lacking to flash related stuff which i’m planning on using…and the Server-side one is very good, but also some (for me) useless chapters (like the “dynamic content” one) on asp, generator and such, coz i’ll never use these.

Check
soysal.com/mod-News-1.html
for a great PHP-editor (FREE!! -went commercial now)
still available for free her:
soysal.free.fr/PHPEd/download.php3

I could be out of my mind but I think I remember seeing info somewhere about the ability of PHP to generate PDF’s dynamically. This of course was before I realized I had an interest in PHP. If anyone has seen anything the like please let me know. I have a site I convert/upload files to PDF for everyday & being able to do this would be an unbelievable help for me. I’m getting off the topic anyway. This is suppose to be a flash board. Sorry for the detour.

Tim