PHP & MySQL tutorial

Hi can anyone point me in the right direction of a good PHP
and MySQL tutorial, particularly for creating login pages?
Thanks

Stefan_Lesik wrote:
> Hi can anyone point me in the right direction of a good
PHP and MySQL tutorial, particularly for creating login pages?
Thanks
I don't know of a free one on the internet, but you might be
interested
in looking at my book, "Foundation PHP for Dreamweaver 8",
which covers
all DW server behaviors, including user authentication.
http://foundationphp.com/dreamweaver8/
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • [PHP-MYSQL] tutorial on using ADDT and dynamic list/form with self-foreign keys?

    Hi all,
    I have a 3 levels catagoris product catalog and would like to manage it
    using dynamic list/forms.
    I'm searching info about using self-foreign keys on dynamic list/forms.
    Is there any tutorial on how to manage this kind of tables using addt?
    tia
    tony

    Hello Tom,
    You were offered the solution on the InterAKT forums, I am not sure why you are posting this problem again. There's also another thread here that presents the same issue and solution:
    http://www.adobeforums.com/cgi-bin/webx/.3bc42a90/0
    Regards,
    Ionut

  • Can't connect PHP/MySQL 404 error

    Wow, the learning curve is killing me. Yet another challenge. I'm using Dreamweaver CC and this tutorial http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html
    I'm at this step:
    Open comments.php. You must have a PHP page open in the Document window to create a MySQL connection.
    In the Databases panel (choose Window > Databases), click the Plus button on the panel and select MySQL Connection.The MySQL Connection dialog box appears.
    Type connTest as the connection name.
    For the MySQL Server, type localhost.If you are using the MAMP default ports on a Mac, use localhost:8889.
    For the User Name, type phptestuser.
    Type the password you chose for the phptestuser account in the Password field.
    For the Database, type php_test.Note: You don't need to precede the underscore with a backslash here. It was inserted by phpMyAdmin in the previous section (see Figure 20) only because phpMyAdmin uses a query that permits wildcard characters.
    Click Test.Dreamweaver attempts to connect to the database. If the connection fails, do the following:
    Double-check the server name, user name, and password.
    Check the settings for the folder Dreamweaver uses to process dynamic pages (see Specifying a Testing Server for Dreamweaver).
    Verify that the web and MySQL servers are both running.
    Temporarily disable any firewall or security program. If the connection works, you need to configure the security program to permit communication between Dreamweaver and MySQL.
    Click OK. The new connection appears in the Databases panel.
    Expand the connTest connection, and then expand the Tables branch. You'll see the comments table in the database, which you can expand to reveal the details of the table columns (see Figure 23).
    As far as I can tell I have followed this tutorial to the letter.
    As far as I can tell, XAMPP/php mySQL are all running fine, the files are in the correct place and everything should be working. However when I hit test I get a 404 error. (Same error when I hit the select button.)
    The suggested problems on the 404 message are:
    1. There is no testing server running on the server machine.
    Pretty sure the testing server is running. Is there any way to test this, other than to note that xampp is definitely running right now and that I can log into phpMYadmin no problem?
    2. The testing server specified for this site does not map to the http://localhost/php_test/_MMServerScripts/MMHTTPDB.php URL Verify that the URL Prefix maps to the root of the site.
    Ummm...I'm pretty sure I put things where I was told to put them in the tutorial, but I'm lost at this point where I should verify what. A clue here? The files are where they are supposed to be, but maybe I entered something wrong? Except...I'm not sure what that could be or where to find it. Whatever IT is.
    Everything in local files is looking good.
    Thanks for your help!
    PS: Extra points to anyone who figures out how to make copy/pasteable error messages! These buggers are the bane of my life!

    Bgupta, you rock!
    I hope you have copied the "mysql.php" and "MMHTTPDB.php" files from "C:\Users\username\AppData\Roaming\Adobe\Dreamweaver CC\locale\Configuration\Connections\Scripts\PHP_MySQL\_mmDBScripts" to "C:\xampp\htdocs\phptest\_mmServerScripts"
    This was EXACTLY the problem. I checked the tutorial and I couldn't even find where the tutorial said to do this. (If I missed it, let me know where in the tutorial it was, please.)
    Fixed!

  • I need help with DW, PHP & MySQL please.

    Hello, I am new to website development and am trying to set up a form for collecting data on my website and have a question that I can’t find an answer to anywhere else. I was wandering if someone there would be kind enough to help?  I am using Dreamweaver in CS4 and my host already has PHP & MySQL installed on the server that I can use.  My question is: Do I need to download XAMP or WAMP on my computer before trying to connect my form to the server?  Also, do I need to change the page I am putting the form on to .PHP extension or can I just embed the PHP form into an existing HTML page?
    Most of the training tutorials I’ve read don’t start at the most basic beginning but rather expect people to already have a basic knowledge of the topics they are trying to learn.  If anyone knows the best place to get answers to the most basic questions like this one or a beginners guide to working with DW, PHP & MySQL I will gladly go there rather than waste your time on questions you’ve probably already answered a bezillion times.
    Thank you for the help.

    Strictly speaking, you don't need XAMPP or WAMP on your local computer. But if you're serious about getting involved with PHP/MySQL, you should definitely set up a local testing environment with one or the other. It's safer and more efficient. Don't expose all your errors on a live server. You can find instructions on  how to set up a testing environment here: http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html.
    To develop with PHP, you should always use a .php file name extension. Any other choice is very rare.
    There's a tutorial on building your first dynamic website with DW here: http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html.
    For more in-depth help, you might want to consider grabbing hold of a copy of "The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP". (Yes, I wrote it, so it's a bit of shameless self-promotion, but you'll find it answers many of your questions - and probably a lot you hadn't even thought of.)

  • Apache2, PHP, MySQL Help

    Hi,
    Sorry if this is a bit of a newbie thing todo but I am not too good with solaris configuration yet.
    Can anyone supply a decent step by step and easy tutorial/how-to on how to set up Apache, PHP, MySQL and PHPmyadmin on a SPARC solaris 10 box please...
    Thanks Rob

    Can anyone supply a decent step by step and easy
    tutorial/how-to on how to set up Apache, PHP, MySQL
    and PHPmyadmin on a SPARC solaris 10 box please...Setting up Apache is very easy since all it takes is setting it up. Its installed by default, you can check /etc/apache for an example configuration file. Next to that www.apache.org/docs/ is also a very valuable read.
    <blunt SPAM>
    You could also consider looking into the Java webserver (formely SunONE). Its currently being made available for free with the Java Enterprise System and compares very well to Apache. If you'll also be doing some Java it would be a better choice (IMO its a better choice than Tomcat) and it can also do PHP.
    http://www.sun.com/software/products/web_srvr/home_web_srvr.xml
    http://www.zend.com/sun/?article=/sun/index.php&kind=&id=6179&open=1&anc=0&view=1
    http://www.php.net/
    </SPAM>
    As you'll note I included the PHP website because with the above setup you'd also need to manually setup PHP. If you have the companion CD present you can install the PHP module which will end up on /opt/sfw/apache. This directory will also present you a php.ini example which will need to be placed in /etc/apache as well. Setting it up is basicly following the documentation in the ini file, and the Apache documentation on adding an extra module (/opt/sfw/apache/libexec/libphp4.so).
    MySQL. Also very easy since its shipped with Solaris as well. Look into /etc/sfw/mysql for a README which covers the most essential steps to set it up. In short you'll need to setup a few directories for MySQL to work and optionally (but recommended) copy the default config file to /etc (/etc/my.cnf) which will define certain basic settings. The readme explains. Next you're likely to need the MySQL guide (if you're new with MySQL) which can be located at http://dev.mysql.com/doc/refman/4.1/en/index.html.
    This applies to the version (close enough anyway) which is shipped with Solaris. From personal experience I can say that MySQL 5 will also run very well on Solaris 10.
    Finally the PHPMyadmin... That really is an RTFM issue, once you have your environment setup (Apache and the likes) its likely you only need to copy it to your document root and point your browser to it.
    Hopes this helps somewhat.

  • PHP/mySQL code help please

    Hi all,
    Thanks to David Powers fab tutorial I am now well on my way to competeing my first dynamique website using PHP/mySQL, (thanks David ), however I am stuck on one particular area....can anyone please help?
    I know that the mySQL database uses the format YYYY/MM/DD for dates, and that is fine. I've sorted out how to display in a more regular format (eg. 1st September 2011) for my application, but I am stuck on how to convert a more regular formatted date entered by the site user into the mySQL format.
    Ideally I would like for the users entry or say either 1/9/11 or 1-9-11 (or something along those lines, to be recognised and displayed on the entry form, but to have a backend function that converts the data to mySQL format. I seem to be reading plenty of forum posts which say this can be done, but unfortunately I can't quite seem to fathom how, or where the code should sit. Would someone mind taking a look at my code page to actually identify what I need to insert, and equally as importantly...where!!!
    Along these lines...is it possible to have a mini-calendar date picker that could be embedded next to the date entry field to ensure that a valid date is entered and in the correct format? Where could this be sourced?
    Thanks in advance of some much needed help
    Mark

    This is becoming really frustrating for me (so god knows how I am to you!!!!), but I usually pick things up so fast and yet this whole PHP/SQL thing is eluding me!!
    I can see (I think) how the code would work, but am struggling to see where it fits into place with my own Dreamweaver 'Update Record' code, as follows. I have spent a couple of days trawling through PHP.net and various other sites and forums before bringing my stupidity to the public domain, but I just can't seem to crack it.
    This one last time then i'll leave you in peace??????
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
        $updateSQL = sprintf("UPDATE gig_guide SET `date`=%s, town=%s, venue=%s, private_or_public=%s, start_time=%s WHERE `index`=%s",
                           GetSQLValueString($_POST['date'], "date"),
                           GetSQLValueString($_POST['town'], "text"),
                           GetSQLValueString($_POST['venue'], "text"),
                           GetSQLValueString($_POST['type'], "text"),
                           GetSQLValueString($_POST['start_time'], "text"),
                           GetSQLValueString($_POST['index'], "int"));
      mysql_select_db($database_online, $online);
      $Result1 = mysql_query($updateSQL, $online) or die(mysql_error());
      $updateGoTo = "index.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $updateGoTo));
    $colname_updatePost = "-1";
    if (isset($_GET['index'])) {
      $colname_updatePost = $_GET['index'];

  • PHP / MySQL help

    Hello all,
    I've got an update record form on one of my pages (it is a
    php / MySQL site). I followed the tutorial in dreamweaver 8, it
    works, but it does not work like I want it to work.
    I am hoping that when a user logs into the site, and they
    want to update their information, they can go to a page that has an
    update record form. This form will have all the fields empty. When
    the user enters information, only the fields that have been entered
    will update the record in the database (and all of the fields that
    are left blank will have no effect on the record in the database).
    How it is now, when the user goes to that page, all the text
    fields are filled with the information contained in the database.
    If they make a mistake, and delete any of those fields, that
    information will be deleted from the database.
    Is this possible to do? If so, is there a tutorial that I
    have not found yet that I can learn how to do this?
    Thank you

    >Is this possible to do?
    Sure it's possible, but I don't really think it's necessary.
    What if the user wants to completely remove the contents of the
    field? And if you don't want to allow that, then you should
    validate those fields anyway.
    Another workflow would be to have the form retrieve the
    database row into static text fields, so at least the user can see
    what is stored. Adjacent to the static fields would be normal text
    fields that they can enter text into if they want to make changes.
    Of course your form processing script would then need to evaluate
    each field for contents. It would then dynamically build the update
    sql based on the filled in fields. I don't know of a specific
    tutorial, but if you know sql and php it should be a piece of
    cake.

  • Apache php mysql installation on arch

    does anyone have a tutorial on how to install :
    - apache
    - php
    - mysql
    on Archlinux
    i have installed apache
    pacman -S apache
    pacman -S php
    pacman -S mysql
    but apache won't start : /etc/rc.d/httpd start - it gives me FAIL
    and when i try httpd it give a nasty error
    httpd: arp_sockaddr_info_get() failed for pufos (pufos - the linux box name)
    httpd: Could not reliably determine the server's fully qualified domain name , using 127.0.0.1 for ServerName
    is because i didnt configureg good httpd.conf or what
    anyway , a tutorial for installing apache php and mysql would be perfect.
    Thank guys

    pacman -S mysql
    /etc/rc.d/mysqld start
    :: Adding mysql group
    /etc/rc.d/mysqld: line 14: groupadd: command not found
    :: Adding mysql user
    /etc/rc.d/mysqld: line 19: useradd: command not found
    chown: 'mysql.mysql': invalid user
    :: Starting MySQL [FAIL]
    omg , if the mysql installed through pacman get stuck cause 'useradd' does not exist as a command .... huuuh
    ??? any sugestions ?

  • [php+mysql] best way to integrate a tree category menu base on db?

    Hi all,
    I have a products catalog where all products are organized in
    categories.
    The category structure is something similar to this:
    category 1
    subcategory 1.1
    sub-subcategory 1.1.1
    sub-subcategory 1.1.2
    sub-subcategory 1.1.3
    sub-subcategory 1.1.4
    sub-subcategory 1.1.5
    subcategory 1.2
    subcategory 1.3
    category 2
    subcategory 2.1
    subcategory 2.2
    sub-subcategory 2.2.1
    sub-subcategory 2.2.2
    sub-subcategory 2.2.3
    sub-subcategory 2.2.4
    subcategory 2.3
    ...and so on...
    In general, I have 3 category levels.
    I manage these catagories with only one table using self
    foreign keys.
    Now I need to add a tree menu that will reflect the above
    category
    structure.
    I use php + mysql to store the tables (products and
    categories.
    I found several javascript samples that allow you to do
    something similar
    but with static data.
    I'm searching for a tree menu that is easily customizable and
    that can use
    dynamic data from mysql db.
    Is there a tutorial or smple that would do the trick?
    TIA very much!
    tony ;).

    The page I'm trying to create is here www.hollisterairshow.com/plan-results.php and the questionnaire is here www.hollisterairshow.com/helpusplan.php .
    I went ahead and created recordsets using advanced recordsets and these seem to be working, here's a sample SQL
    SELECT *
    FROM plan
    WHERE Saturday = 'Saturday' AND plan.howArriving = 'Auto'
    I created a recordset for each combination of day and transportation mode - six in all
    This selected the correct records.
    To display the count of how many records selected I then used in DW Insert/Data Objects/ Display Record Count/Total Records which generated the following code:
    <?php echo $totalRows_rsSatAuto ?>
    This worked OK - not elegant but OK and I repeated it for each combination of Day and Transportation mode!!
    So there are two problems I'm having:
    I know I can select the records I want but how do I display the sum of the column containing "How many in your party" - i.e. in the PHP code generated above what do I replace $totalRows_rsSatAuto with?
    There are two questions using radio buttons where I'd like to display the count and % for each option selected. I can select all records for these questions but what code do I put to sum the number of selections for each option and what code do I put to calculate the percentage
    I understand the arithmetic involved which is pretty simple but it's the mechanics of coding that has me stumped. It would really help if you could give me a sample for say the "Are you camping overnight" question which has a "Yes/No" option only. In my mundane way I would create two recordsets, one for "Yes" and one for "No", and use the same technique I describe above for counting Total Records in each recordset, but then I'm stuck with how do I calculate and display the percentages. I must be missing something very obvious as I'm sure there just has to be a more elegant solution.
    Thanks so much for your continued interest.
    Tony

  • Database Connection using PHP/MySQL on OS X

    I created a database connection originally on my XP machine
    using Dreamweaver CS2 and everything worked as it should. I
    recently switched to a Mac and CS3 and while I can see the
    connection file in the Connections folder, it appears grayed out in
    Dreamweaver. I tried to create a new data connection to see if that
    would solve this problem, but it won't let me. I typed in all the
    information and when I clicked "Test" or to browse for the
    appropriate database it pops up an error message saying "An
    unidentifiable error has occurred". I'm sure I could work around
    this by manually coding everything, but I'm a novice in programming
    and need to be able to use this feature. The worst thing about it,
    is that anytime I have to make a change to the web page, even if
    it's not regarding this section of code, it gets messed up. I have
    made backups, but once they are opened on the Mac they are messed
    up.
    I'm using Dreamweaver CS3, PHP/MySQL on a remote server as I
    still can't get my local web server functioning properly under
    Leopard. Any help would be appreciated because I haven't been able
    to find anything regarding this error online.

    bouldersp wrote:
    > I typed in all the
    > information and when I clicked "Test" or to browse for
    the appropriate database
    > it pops up an error message saying "An unidentifiable
    error has occurred".
    That usually means that something is preventing communication
    between
    Dreamweaver and the testing server. It could be a firewall or
    anti-virus
    software. In the Testing Server section of the Advanced tab
    in Site
    definition, Host directory and URL prefix should both point
    to the same
    place. The first is the physical path to the top level of
    your site, the
    second is the URL you enter into a browser address bar to get
    to the
    same location.
    > I'm using Dreamweaver CS3, PHP/MySQL on a remote server
    as I still can't get
    > my local web server functioning properly under Leopard.
    You might find this tutorial on my website helps:
    http://foundationphp.com/tutorials/php_leopard.php
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • PHP/MySQL connection / testing server maybe?

    Problem - I'm unable to connect to a PHP database. I'm
    working right now with tutorials from the DW CS3 Bible by Lowery,
    but haven't been able to connect at all. And I wasted weeks trying
    the same thing with an ASP connection.
    The error message I'm getting now is '405 Method not Allowed'
    when working through the connection dialog. I thought PHP/MySQL was
    supposed to be easier & better than ASP/Access?
    In going through the site setup, instructions for setting up
    the site's testing server say 'click test to verify the connection'
    but there's no button to click. What am I missing?
    Is there some kind of easy test script I can attempt, as with
    asp? Problem there was that I could do the 'timetest' sample, but
    nothing else.
    I have gone through setting permissions and creating IUSR_my
    computer name as a user - they seemd to work fine, but I still
    can't connect.
    Thanks anyone, and everyone - my first post regarding
    connection problems was on 8/22 and I feel like I have gotten
    nowhere.

    Have you looked at this tutorial?
    http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html
    Ken Ford
    Adobe Community Expert Dreamweaver/ColdFusion
    Adobe Certified Expert - Dreamweaver CS3
    Adobe Certified Expert - ColdFusion 8
    Fordwebs, LLC
    http://www.fordwebs.com
    "LReber" <[email protected]> wrote in
    message
    news:gcegd6$qmu$[email protected]..
    > Problem - I'm unable to connect to a PHP database. I'm
    working right now
    > with
    > tutorials from the DW CS3 Bible by Lowery, but haven't
    been able to
    > connect at
    > all. And I wasted weeks trying the same thing with an
    ASP connection.
    > The error message I'm getting now is '405 Method not
    Allowed' when working
    > through the connection dialog. I thought PHP/MySQL was
    supposed to be
    > easier &
    > better than ASP/Access?
    > In going through the site setup, instructions for
    setting up the site's
    > testing server say 'click test to verify the connection'
    but there's no
    > button
    > to click. What am I missing?
    > Is there some kind of easy test script I can attempt, as
    with asp? Problem
    > there was that I could do the 'timetest' sample, but
    nothing else.
    > I have gone through setting permissions and creating
    IUSR_my computer name
    > as
    > a user - they seemd to work fine, but I still can't
    connect.
    > Thanks anyone, and everyone - my first post regarding
    connection problems
    > was
    > on 8/22 and I feel like I have gotten nowhere.
    >

  • Help with php mysql connect script

    Ok guys im new to php mysql and i'm trying to insert some
    form information in my database. Im using a script from sitepoint
    in which i went through the tutorial did some experiments of my own
    and it worked....
    but now i'm getting this error which i cant figure out....
    Error placing order: You have an error in your SQL syntax;
    check the manual that corresponds to your MySQL server version for
    the right syntax to use near 'order SET product ='1',
    size='medium', color='', quantity = '1' at line 1
    here is the page
    http://vaughntucker.com/imagecon/hats.php
    and this is the script
    <?php
    //default page display
    //connect to database
    $dbcnx = @mysql_connect('p3nl41mysql7.secureserver.net',
    'imagecon', 'Dub*boss_1');
    if (!$dbcnx) {
    echo '<p> Unable to connect to the '. 'database server
    at this time.</p>';
    exit();
    //select database
    if (!@mysql_select_db('imagecon')) {
    exit('<p>Unable to locate the ' .
    'database at this time.</p>');
    //Mysql query add joke
    if (isset($_POST['submit'])) {
    $product = 1;
    $size = $_POST['size'];
    $color = $_POST['color'];
    $quan = $_POST['quantity'];
    $sql = "INSERT INTO order SET
    product ='$product',
    size='$size',
    color='$color',
    quantity = '$quan',
    date = CURDATE()";
    }else{
    echo 'No data submited';
    if (@mysql_query($sql)) {
    echo '<p>Your order has been submited.</p>';
    } else {
    echo '<p>Error placing order: ' .
    mysql_error() . '</p>';
    ?>
    thanks in advance

    $sql = "INSERT INTO order SET
    product ='" . $product . "',
    size='" . $size . "',
    color='" . $color . "',
    quantity = '" . $quan . "',
    I believe there are other more elegant ways to do this, as
    well.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "beatzMalone" <[email protected]> wrote in
    message
    news:[email protected]...
    > Ok guys im new to php mysql and i'm trying to insert
    some form information
    > in
    > my database. Im using a script from sitepoint in which i
    went through the
    > tutorial did some experiments of my own and it
    worked....
    >
    > but now i'm getting this error which i cant figure
    out....
    >
    > Error placing order: You have an error in your SQL
    syntax; check the
    > manual
    > that corresponds to your MySQL server version for the
    right syntax to use
    > near
    > 'order SET product ='1', size='medium', color='',
    quantity = '1' at line 1
    >
    > here is the page
    >
    http://vaughntucker.com/imagecon/hats.php
    >
    > and this is the script
    > <?php
    > //default page display
    > //connect to database
    > $dbcnx = @mysql_connect('p3nl41mysql7.secureserver.net',
    'imagecon',
    > 'Dub*boss_1');
    > if (!$dbcnx) {
    > echo '<p> Unable to connect to the '. 'database
    server at this
    > time.</p>';
    > exit();
    >
    > }
    >
    > //select database
    > if (!@mysql_select_db('imagecon')) {
    > exit('<p>Unable to locate the ' .
    > 'database at this time.</p>');
    > }
    >
    > //Mysql query add joke
    > if (isset($_POST['submit'])) {
    > $product = 1;
    > $size = $_POST['size'];
    > $color = $_POST['color'];
    > $quan = $_POST['quantity'];
    > $sql = "INSERT INTO order SET
    > product ='$product',
    > size='$size',
    > color='$color',
    > quantity = '$quan',
    > date = CURDATE()";
    > }else{
    > echo 'No data submited';
    >
    > }
    > if (@mysql_query($sql)) {
    > echo '<p>Your order has been submited.</p>';
    > } else {
    > echo '<p>Error placing order: ' .
    > mysql_error() . '</p>';
    > }
    >
    >
    >
    > ?>
    >
    > thanks in advance
    >

  • Football/soccer results grid advice php/mysql

    I need to create the above from my database, and I am not sure how to go about it.
    Basically  this calculates all the goals scored against another team. If team 1  (column) is the same as team 1 (row) an "x" is put in place as team 1  cannot play itself
    I have added my database structure
    Image of example
    http://filedb.experts-exchange.com/incoming/2010/08_w34/t337870/Untitled-1.jpg
    CREATE TABLE IF NOT EXISTS `matches` (
      `match_id` int(8) NOT NULL auto_increment,
      `date` date default NULL,
      `time` varchar(5) default NULL,
      `report` longtext,
      `referee_id` int(8) NOT NULL,
      `season_id` int(8) NOT NULL,
      PRIMARY KEY  (`match_id`),
      KEY `referee_id` (`referee_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
    -- Dumping data for table `matches`
    INSERT INTO `matches` (`match_id`, `date`, `time`, `report`, `referee_id`, `season_id`) VALUES
    (1, '2010-08-02', '15:00', 'N/A', 1, 2010),
    (2, '2010-08-10', '15:00', 'n/a', 1, 2010);
    CREATE TABLE IF NOT EXISTS `matchscores` (
      `matchscores_id` int(8) NOT NULL auto_increment,
      `match_id` int(8) NOT NULL,
      `team` int(8) NOT NULL,
      `score` int(8) default NULL,
      PRIMARY KEY  (`matchscores_id`),
      KEY `match_id` (`match_id`,`team`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
    -- Dumping data for table `matchscores`
    INSERT INTO `matchscores` (`matchscores_id`, `match_id`, `team`, `score`) VALUES
    (1, 1, 1, 2),
    (2, 1, 2, 1);
    CREATE TABLE IF NOT EXISTS `team` (
      `team_id` int(8) NOT NULL auto_increment,
      `team_name` varchar(255) NOT NULL,
      `team_address` text,
      `team_phone` varchar(25) default NULL,
      `team_email` varchar(255) default NULL,
      `team_web` varchar(255) default NULL,
      `colours_home` varchar(50) default NULL,
      `colours_away` varchar(50) default NULL,
      `manager` varchar(255) default NULL,
      `assistant` varchar(255) default NULL,
      `club_rep` varchar(255) default NULL,
      `division` varchar(255) default NULL,
      `team_pic` varchar(255) default NULL,
      `team_logo` varchar(255) default NULL,
      `profile` mediumtext,
      `honours` mediumtext,
      `password` varchar(10) NOT NULL,
      PRIMARY KEY  (`team_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

    Tbilly,
    I have just the thing you are looking for. Check this out
    here:
    http://www.smithmediafusion.com/poll/poll.html
    MySQL and php with a Flash front.
    drop me an email if you are interested and would like more
    info.
    danswhc AT yahoo dot Com
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    <--check this
    *Must Read*
    http://www.smithmediafusion.com/blog
    "tbilly" <[email protected]> wrote in
    message
    news:erfeo6$9a$[email protected]..
    > Can anyone recommend a book or tutorial for a survey or
    poll script I
    > could
    > implement using php/MySQL? Preferably one with options
    such as: changing
    > question types (radio vs. checkboxes), sessions, and
    graphical displays of
    > results. Would like to use dreamweaver to set up content
    management pages
    > to
    > edit/add answers and questions in a database. Thanks in
    advance.
    >

  • Installed PHP & MySQL, and now I have file permission errors.

    Hi Everyone
    I recently made a switch from using MAMP to making a separate installation of PHP, MySQL and Rails. I used the first tutorial for Rails + MySQL, and the second one for PHP;
    http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx
    http://www.entropy.ch/software/MacOSx/mysql/
    Unfortunately, I now receive errors when trying to install activeCollab through it's own PHP install script, and WordPress won't let me import xml backups into a locally installed WordPress. This must mean that I don't have full Read/Write access to my 'Sites' directory (this is set as my default htdocs in the Apache httpd.conf). I haven't noticed any problems with Rails - so far it's only been PHP based CMS's which have thrown up the permission errors.
    I've checked the file permissions on my 'Sites' folder - I'm the only user on the machine, and my account has full Read/Write access to the folder. However, I've noticed that there is also the option to choose 'Group' access, for which my account is again selected and given Read/Write access.
    Then there is 'Others' category, and this has 'Read only' access. Is there an option in there which I need to select and give Read/Write permissions to? mysql, php ?
    Or, is there a MySQL/PHP/Apache config file somewhere, within which I need to give global read/write permissions?
    I didn't have this problem when I was served up local sites from MAMP - and I also configured MAMP to use the 'Sites' folder as it's default htdocs folder. I get the impression that because MAMP was installed as an 'Application', that it automatically inherited my user permissions - maybe PHP and MySQL don't inherit my user account permissions because they are services?...
    I've come very far with getting everything installed to work with the OS X bundled Apache server (which I believe is 1.3 - I certainly haven't updated it) so I'd love to get everything finally configured - therefore, any help with this is very, very much appreciated!
    MacBook Pro 2.4Ghz    

    You'll probably get a better response at the Server Products or Networking & Web http://discussions.apple.com/forum.jspa?forumID=733 forums.

  • Starting out php/mysql

    Hello, i am new to php so be prepared for a idiots
    question,Hello, Do i need to run this on my localhost or can i run
    it on my virtual server as this allready has php mysql etc
    installed.
    i am new to php so be prepared for a idiots question, i have
    been trying to copy a youtube tutorial to create a navbar using php
    mysql and dreamweaver "
    http://www.youtube.com/watch?v=habZHcnShfs"
    to do this i need to create a mysql tabel in dreamweaver, to do
    this i have been useing the following code;
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    $user="james1892";
    $password="14011991";
    $database="naviagation";
    mysql_connect("localhost",$user,$password);
    @mysql_select_db($database) or die("unable to select
    database");
    $query = 'CREATE TABLE 'menu' (
    'mid' TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
    'name' varchar(20) NOT NULL
    'link' varchar(100) NOT NULL,
    PRIMARY KEY ( 'mid' )
    mysql_query($query);
    mysql_close();
    ?>
    </body>
    </html>
    this then returns the following message "Parse error: syntax
    error, unexpected T_STRING in
    /var/www/vhosts/sickstudentgames.com/httpdocs/php attempt 1/first
    database midnamelink.php on line 15"
    i then gave up on thsi as i couldnt work out what was the
    problem and started a new code to create a database using this code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    $con = mysql_connect("localhost","com1892","14011991");
    if (!$con)
    die('Could not connect: ' . mysql_error());
    }if (mysql_query("CREATE DATABASE my_db",$con))
    echo "Database created";
    else
    echo "Error creating database: " . mysql_error();
    }mysql_close($con);
    ?>
    </body>
    </html>
    this then showed the folling message "Warning:
    mysql_connect(): Access denied for user 'com1892'@'localhost'
    (using password: YES) in
    /var/www/vhosts/sickstudentgames.com/httpdocs/php attempt
    1/tableattempt2.php on line 10
    Could not connect: Access denied for user
    'com1892'@'localhost' (using password: YES)"
    i have been uploading these to my website server as this has
    php and mysql installed could this be the problem do i need to run
    it on the coputers localhost>?
    any help greatly appriciated
    thanks you
    i have been trying to copy a youtube tutorial to create a
    navbar using php mysql and dreamweaver "
    http://www.youtube.com/watch?v=habZHcnShfs"
    to do this i need to create a mysql tabel in dreamweaver, to do
    this i have been useing the following code;
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    $user="james1892";
    $password="14011991";
    $database="naviagation";
    mysql_connect("localhost",$user,$password);
    @mysql_select_db($database) or die("unable to select
    database");
    $query = 'CREATE TABLE 'menu' (
    'mid' TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
    'name' varchar(20) NOT NULL
    'link' varchar(100) NOT NULL,
    PRIMARY KEY ( 'mid' )
    mysql_query($query);
    mysql_close();
    ?>
    </body>
    </html>
    this then returns the following message "Parse error: syntax
    error, unexpected T_STRING in
    /var/www/vhosts/sickstudentgames.com/httpdocs/php attempt 1/first
    database midnamelink.php on line 15"
    i then gave up on thsi as i couldnt work out what was the
    problem and started a new code to create a database using this code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    $con = mysql_connect("localhost","com1892","14011991");
    if (!$con)
    die('Could not connect: ' . mysql_error());
    }if (mysql_query("CREATE DATABASE my_db",$con))
    echo "Database created";
    else
    echo "Error creating database: " . mysql_error();
    }mysql_close($con);
    ?>
    </body>
    </html>
    this then showed the folling message "Warning:
    mysql_connect(): Access denied for user 'com1892'@'localhost'
    (using password: YES) in
    /var/www/vhosts/sickstudentgames.com/httpdocs/php attempt
    1/tableattempt2.php on line 10
    Could not connect: Access denied for user
    'com1892'@'localhost' (using password: YES)"
    any help greatly appriciated
    thanks you

    james1892 wrote:
    > Hello, i am new to php so be prepared for a idiots
    question,Hello, Do i need to
    > run this on my localhost or can i run it on my virtual
    server as this allready
    > has php mysql etc installed.
    You don't need a local testing environment, but it's highly
    recommended
    that you do. It's much more efficient and secure.
    > i have been trying to
    > copy a youtube tutorial to create a navbar using php
    mysql and dreamweaver
    > "
    http://www.youtube.com/watch?v=habZHcnShfs"
    I watched about four minutes of that "tutorial". It's totally
    useless.
    > $query = 'CREATE TABLE 'menu' (
    > 'mid' TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
    > 'name' varchar(20) NOT NULL
    > 'link' varchar(100) NOT NULL,
    > PRIMARY KEY ( 'mid' )
    > )';
    The reason that doesn't work is because the creator of the
    "tutorial"
    failed to explain the difference between quotation marks and
    backticks.
    What actually appears on screen is not what you have typed,
    but this:
    $query = 'CREATE TABLE `menu` (
    `mid` TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
    `name` varchar(20) NOT NULL
    `link` varchar(100) NOT NULL,
    PRIMARY KEY ( `mid` )
    Note the difference between ' and `. The second one is called
    backtick,
    and is located above the tab key on most keyboards. In this
    case, you
    don't need it. The following would be fine:
    $query = 'CREATE TABLE menu (
    mid TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
    name varchar(20) NOT NULL
    link varchar(100) NOT NULL,
    PRIMARY KEY (mid)
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

Maybe you are looking for