A Flash Developer Resource Site

Page 3 of 3 FirstFirst 123
Results 41 to 55 of 55

Thread: Anybody Into SQL/PHP?

  1. #41
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Also....there are some pretty cool 3rd party extensions for dreamweaver that have better recordet paging. There are some free ones and commercial ones (all affordable) at places like dmxzone.com. Worth a google too.

  2. #42
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Just an item to look at: it is usually not the best idea to make a mysql server accessible to the world, so your host may have access limited to it (or allow to change access from the admin pages)
    When you upload a script to your server (including that phpmyadmin) the mysql connection will be made from some machine in the host's server park to another machine there (or maybe the same one)
    When you try to run mysql front from your desktop, the connection will be made from your desktop.

    Musicman

  3. #43
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    so your host may have access limited to it
    Yeah, I understand that. but then, why did DW have no problems connecting? That's the part that really bugs me.

    I don't know enough about it yet, but could it be because it's connecting through that connect.php script that DW wrote?

    That one app, Front, has an option to do that. Maybe I need it to work? Cause going direct doesn't.

    Here's what it looks like;

    PHP Code:
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_conn_newland "xxxxxxxxxxxxxxxxx";
    $database_conn_newland "xxxxxxxxx";
    $username_conn_newland "xxxxxxxxx";
    $password_conn_newland "xxxxxxxxxx";
    $conn_newland mysql_pconnect($hostname_conn_newland$username_conn_newland$password_conn_newland) or trigger_error(mysql_error(),E_USER_ERROR); 
    ?>
    Last edited by Ask The Geezer; 12-06-2005 at 03:44 AM.

  4. #44
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    well you have got a php script that is uploaded to your server - as opposed to a client that connects straight from your deskttop
    It would make sense for mysql front to provide a php script (or maybe scripst in other languages as well) that needs to be placed on your server, in order to avoid the access restriction.

    BTW: it is somewhat unwise to use the mysql_pconnect variant for connection to a (I presume) shared host. If DW writes that as default, a big eek to the program

    Musicman

  5. #45
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Well, I just found all this out since this thread started.

    But yes, Dreamweaver wrote all that and apparently uploaded it all. And it is a shared server. Well, I think it is. My partner set it up, and I'm pretty sure it's not a dedicated server.

    I've got one other little problem that doesn't jibe with the book. It's how to get the dollar sign, $ in php. This line was supposed to do that, but it outputs USD and I haven't found anything to tell me different.

    PHP Code:
    <?php setlocale(LC_MONETARY'en_US'); echo money_format('%i',$tourPrice); ?>
    Do you know what it's supposed to be?

  6. #46
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Hi "Ask The Geezer".
    I know you have siad that you are not interested doing a setup for script testing, but I suggest you reconsider. There are several free packages that will install everything you need without having to do anything but click ok.

    Heres the one I use when I need a quck setup:
    http://www.firepages.com.au/

    This will install:
    Apache webserver
    PHP
    MySql
    phpMyAdmin
    and a few other goodies I never use.

    Install has been error free evertine I have used it and I have a local server running within 3 minutes.

    The nice thing about it is that you can do 99% of your testing without ever having to upload anything to another server.
    Just create a new directory in C:\phpdev\www whenever you start a new project, browse to http://localhost/your_directory/filename.php to test your script.

    Alot easier and really helps the beggining scripter get a grasp on php and MySql in an environement that is safe from the outside world and which it is easier to view and edit MySql tables and data.

    Hope it helps.

    3P
    Last edited by 3PRIMATES; 12-06-2005 at 05:16 PM.

  7. #47
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Yes, your right. I'm just so new to this that I wanted to be sure I could put the mySQL on this server without going back to school.

    Is this the one your talking about? phpdev423 11.5MB 325398 downloads to date -

  8. #48
    poet and narcisist argonauta's Avatar
    Join Date
    Nov 2001
    Location
    Under the bed
    Posts
    2,080
    setlocale is a function that helps you configure your server regional parameters. As in windows you can set your keyboard to an specific language, you can also do so with your php script,

    setlocale(LC_MONETARY, 'en_US'); basically sets your currency to us dollars (en_US english U.S.)

    echo: echo outputs the result to the screen
    echo 'hello'; will output hello to your screen

    money_format is another function that takes your number and adds the format.

    One thing about php is that it's well documented, and you can find good examples in their manual
    http://www.php.net/function.setlocale
    http://www.php.net/money_format

    Whenever you don't understand how a function works, it's always helpful to go there, they'll explain, give examples and in the comments there are all kinds of problems and solutions.

    ----------------

    about phpMyAdmin

    it's not a desktop application, it has no executable. It's a set of php scripts. As php runs in a web server, you'd have to upload it to your webserver, then you'd have access to it by writing the url http://yoursite.com/phpmyadmin/

    there should be a file named config.inc.php, if there isn't, there should be a file named config.default.php, rename it to config.inc.php and edit it. It has comments to know how you should edit it. There you basically have to config what your mysql server is (usually localhost, if you upload this to the same server where the mysql is. user and password).


    Just as you've been doing your own php script to insert records to your DB, phpmyadmin is a collection of script that should help you do the same.


    Hope it helps.
    my blog: blog.innocuo
    Sponsored by your mom.

  9. #49
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    There you basically have to config what your mysql server is (usually localhost, if you upload this to the same server where the mysql is. user and password).
    Click! It just snapped into place for me. Thanks Argo.

    Great Argo. That second link taught me to use this in that money line above, '%#4n' instead of '%i'.

    Going from a Macromedia book, I don't expect bad code from it. This is the first one that didn't work tho, so maybe it's the version of sql or php is on the server? They would read them different?
    Last edited by Ask The Geezer; 12-06-2005 at 07:09 PM.

  10. #50

  11. #51
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Hey Chris.

    OK, I just found out there is no direct connect to the database at this host. That means a php tunnel, and they gave me an example script to use. I tried the Front one last night, but I think I got it in the wrong place or didn't know how to target it.

  12. #52
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Probobly best I step out of this thread.

    I will say them not having DB control would be a red flag to me. There are too many commercial hosts to choose from that do have control. Personally, these are the reasons I got away from commercial hosts in the first place and use a suite as others have suggested to you. Easier to author right to the webspace (no upload time), easier to configure and easier to manage, especially if you are on need of a server simply for testing things and routines.

    As for the sql itself...I think you have a handle on it.

  13. #53
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Yes that is the one that I was talking about. The only problem I have found with that php development suite is that the php 4.3.0 upgrade doesn't seem to work.
    That really not a huge problem though. I upgraded manually although it was a bit more work.
    php version 4.2.3 is still valid and still used on production servers, although 4.3 and 5.0 are also used. You shouldn't worry to much about upgrading right now if you decide to install the suite. There are several other suites available out there and I am not really in the know about which one is best at this time. You might want to ask around because there may be one that is better than what I recommended.

  14. #54
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Just an update. I installed it, but since I'm not much of a coder, the config file was just too much for me. Then I started having problems with my copmputer. all my sliders in all apps started acting funny. I'd drag them down, they would slide back to the top, even the Start/Shutdown dropdown was going banannas. So I ended up uninstalling everything, and the conflict went away.

    I ended up trying PHPRunner, and it does everything I wanted.

    But of course, my real problem is that it all so new to me I really don't know what I'm doing yet.

  15. #55
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Very odd. I have never heard of anything like that before.

    3P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center