Map MySQL to ArrayCollection in PHP

Hi Guys
I have had great success in passing data to flex using Zend AMF as an array of objects and using the result to populate Flex Charts.
The problem is I want to use FusionCharts for Flex, this require me to pass an ArrayCollection to the FusionChart. The problem I am have having is building the the ArrayCollection in PHP.
Eg
$sql ="select label,value from table";
$result = mysq_query($sql);
while($row=mysql_fetch_object($result)
What code do I put here to build the arraycollection to pass back to flex
Here is what I am trying to mirror in flex
private var chartData:ArrayCollection=new ArrayCollection([
                 { label:'Jan', value:'17400' },
                 { label:'Feb', value:'19800' },
                 { label:'Mar', value:'21800' },
                 { label:'Apr', value:'23000' },
                 { label:'May', value:'29000' },
                 { label:'Jun', value:'27600' }
Thanks in advance
Chris

hi powder77,
$mysqli = new mysqli("localhost", "user", "password", "db");
$q = "SELECT label, value FROM table";
$r = $mysqli->query($q);
$myReturn = array();
while( $row = $r->fetch_objects() ) {
     $myReturn[] = $row;
return $myReturn;
a couple suggestions: use mysqli (it's improved) and use oo in php whenever possible (but stay consistent!).
- e

Similar Messages

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • CS3 mysql database connection using php

    Hi, this is my first time trying to connect to a database.  I have created a mysql database with my hosting provider.  I am also configured to use php. I have ready numerous threads on this topic, but am still confused.
    I am getting the following error message:
    When I enter the following information into the connection string, I get the following error Error http error code 404 file not found. The site does not map to ftp.readyhosting.com/_mmserverscripts/mmhttdb.php Is the location of mysql server correct? Connection name ? user defined ?aosprod?
    Mysql server = aoswebeditor.readyhostingmysql.com.  Also, this is not the same location as the web server. 
    The hosting company provides the following php code to connect to the database. 
    <?php
    $link = mysql_connect('aoswebeditor.readyhostingmysql.com', 'aosweb', '*password*');
    if (!$link) {
        die('Could not connect: ' . mysql_error());
    echo 'Connected successfully';
    mysql_select_db(aos);
    ?>
    Because of the connection dialog boxes in CS3, I have not used this php code but only used the mysql server aoswebeditor.readyhostingmysql.com.
    My requirements are very simple, I want to use the same remote database for the dreamweaver connection for the remote and testing server.
    Any ideas would be appreciated.
    Thanks. George

    First of all, you seem to be mixed up about terminology. ASP stands for Active Server Pages, and is a type of server technology similar to PHP. I think you mean ISP (Internet Service Provider). However, this is not correct, either. An ISP provides your connection to the internet. Although some ISPs also host websites for their customers, your website is normally located at a hosting company. You need to get that mixup out of the way. Otherwise, you might confuse people with future questions about ASP, when you actually mean something completely different.
    OK, lecture over...
    Your hosting company is following standard procedure by preventing remote access to MySQL databases. However, Dreamweaver does make it possible to use your remote database and website for testing purposes. It does so by uploading a hidden folder called _mmServerScripts to your remote server. This performs a local connection with your database, and then sends the results back to your local computer. When setting up your testing server definition in Dreamweaver, you need to provide the details as I indicated before. When creating a MySQL connection in Dreamweaver, fill in the server name and account details as given to you by your hosting company. If everything is set up correctly, you should be able to use your remote server and database for testing.
    Having said that, it is much better to install a local testing environment. You'll find it faster, and it also lets you make mistakes (an essential part of the learning process) in the security of a closed environment. For details of how to set up a local testing environment, see this article in the Adobe Developer Connection.

  • Inserting Into MYSQL Table Via Air/PHP = Not Allowed?

    I'm having trouble inserting data into my mysql database tables through my air app. All the code is pretty much exactly the same as in some examples I've seen but it simply won't do it. Is this because of some sort of security restriction because the air app is on my machine and the server with my mysql database on is elsehwhere? Or is it possible to insert data via an air app?
    Here is the example I've been following:-
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html

    jimmyoneshot wrote:
    Thanks for the answers boys. I've decided I'm going to change it into a flex app instead as then there won't be any problems. It simply means I'll have to add a logon system to it.
    While were on the subject do you guys happen to know of any examples anywhere of how someone can REMOVE data from an sql table via flex/php?
    What I'm looking for is basically when a user uses my app and enters info into some text inputs, if that specfic info exists within a table then that data will be removed from the table. The way this works is that they will choose an item within a tilelist which is populated by the data from this mysql table and this will insert the data of the selected item into the text inputs and then they click a remove button to remove that item. Can't find anything similar anywhere though.
    You will have to use a common identifier, eg:
    give each row in your database an ID.
    then pass that ID value on the button press to a PHP script, which does something like:
    $deleteID = $_POST["delID"];
    mysql_query("DELETE FROM exampleTable WHERE ID='$deleteID
    maybe check that a row with that ID exists first for verification, then pass back a value indicating if removal was a success or not.
    You can delete on other values, but remember they have to be unique for the database, else you'll run the risk of deleting multiple values.
    Or you could delete on a compound key, depends on the data you're storing in the grid.

  • MySQL date fomat with PHP

    I have a problem with format date stored in mySql db ( in the
    fied named 'dt_news') as dd-mm-yyyy.
    Now when I view my php page where I show all the records, I
    have the following type yyyy/mm/dd.
    Please help me to modify the attached code an have that
    result.

    Add to your code
    <?php
    function mysql2date($date){
    $temp = explode("-",$date);
    $newdate = $temp[2] . "/" . $temp[1] . "/" . $temp[0];
    return $newdate;
    Then instead of:
    <?php echo $row_View_News['dt_news']; ?>
    Use:
    <?php echo mysql2date($row_View_News['dt_news']); ?>
    This will change the mysql date format from YYYY-MM-DD to
    DD/MM/YYYY
    Gareth
    http://www.phploginsuite.co.uk/
    PHP Login Suite V2 - 34 Server Behaviors to build a complete
    Login system.

  • Mysql.sock error with php

    Hi,
    I'm trying to get MySQL working on my Mac running OS X 10.5.1
    The server runs and I have imported one of my databases into
    it. However when I run Dreamweaver and try and add the new database
    I get this error in Dreamweaver;
    Can't connect to local MySQL server through socket
    '/var/mysql/mysql.sock' (38)
    Speaking with MySQL they have said that file is found in
    /tmp/
    I have copied it and added it where DW wants it but still no
    joy.

    there seems to be a simpler perm fix farther down the page-
    It can be much simpler.
    sudo cp /etc/php.ini.default /etc/php.ini
    sudo chmod 777 /etc/php.ini
    Open the file with a nice Editor, like PathFinder or BBEdit.
    Find the line for the mysql.default.host
    ; Default socket name for local MySQL connects. If
    empty, uses the built-in
    ; MySQL defaults.
    mysql.default_socket = /tmp/mysql.sock
    and enter: /tmp/mysql.sock
    You will then have:
    ; Default socket name for local MySQL connects. If
    empty, uses the built-in
    ; MySQL defaults.
    mysql.default_socket = /tmp/mysql.sock
    save it, go back to terminal and enter:
    sudo chmod 644 /etc/php.ini
    You then can restart Apache and SQL, or do a normal restart.
    It should work
    afterwards.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Problems with mysql after update to php 5.3

    Hi everyone,
    I know I am not the only one having trouble with that upgrade but so far I still have some issues.
    I have read the news about the update and the wiki. I use apache, php, mysql and phpmyadmin.
    After the update, I installed php-apache, php-mcrypt and used php.ini.pacnew to do my new configuration.
    Everything works fine except mysql.
    I have a weird problem that is that I can access and do whatever I want to databases with phpmyadmin but as soon as I try to connect to the mysql database with php code then my browser tells me that the page can't be loaded and that "the connection terminated unexpectedly". What is the problem ? Am I the only one in this situation ?
    Thanks for your time !

    Here it is, that's the error log of httpd:
    [Sun Sep 27 17:25:07 2009] [notice] child pid 2006 exit signal Segmentation fault (11)
    [Sun Sep 27 19:40:32 2009] [error] [client 127.0.0.1] File does not exist: /srv/http/favicon.ico
    [Sun Sep 27 19:40:36 2009] [error] [client 127.0.0.1] File does not exist: /srv/http/favicon.ico
    [Sun Sep 27 19:40:37 2009] [error] [client 127.0.0.1] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/yms/projects/homepage/yms/index.php on line 60, referer: http://localhost/~yms/
    [Sun Sep 27 19:40:37 2009] [error] [client 127.0.0.1] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/yms/projects/homepage/yms/index.php on line 73, referer: http://localhost/~yms/
    [Sun Sep 27 19:40:37 2009] [error] [client 127.0.0.1] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/yms/projects/homepage/yms/index.php on line 60, referer: http://localhost/~yms/
    [Sun Sep 27 19:40:37 2009] [error] [client 127.0.0.1] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/yms/projects/homepage/yms/index.php on line 73, referer: http://localhost/~yms/
    [Sun Sep 27 19:40:37 2009] [error] [client 127.0.0.1] File does not exist: /srv/http/favicon.ico
    [Sun Sep 27 19:40:38 2009] [notice] child pid 2003 exit signal Segmentation fault (11)
    [Sun Sep 27 19:40:38 2009] [notice] child pid 2577 exit signal Segmentation fault (11)
    And that's the access log in case it is useful:
    127.0.0.1 - - [27/Sep/2009:19:40:32 +0200] "GET / HTTP/1.1" 200 788
    127.0.0.1 - - [27/Sep/2009:19:40:32 +0200] "GET /favicon.ico HTTP/1.1" 404 1085
    127.0.0.1 - - [27/Sep/2009:19:40:32 +0200] "GET /icons/blank.gif HTTP/1.1" 200 148
    127.0.0.1 - - [27/Sep/2009:19:40:32 +0200] "GET /icons/folder.gif HTTP/1.1" 200 225
    127.0.0.1 - - [27/Sep/2009:19:40:36 +0200] "GET /~yms HTTP/1.1" 301 368
    127.0.0.1 - - [27/Sep/2009:19:40:36 +0200] "GET /~yms/ HTTP/1.1" 200 1150
    127.0.0.1 - - [27/Sep/2009:19:40:36 +0200] "GET /favicon.ico HTTP/1.1" 404 1085
    127.0.0.1 - - [27/Sep/2009:19:40:36 +0200] "GET /icons/back.gif HTTP/1.1" 200 216
    127.0.0.1 - - [27/Sep/2009:19:40:37 +0200] "GET /favicon.ico HTTP/1.1" 404 1085
    And thanks for trying to help me ;-)

  • Map MySQL Tables in RPD

    1. Created new physical database in RPD for MySQL
    2. Setup Connection Pool
    -- Call Interface ODBC 3.5
    -- Checked: Shared Logon, Enable connection pooling, Use multithreaded connections and parameters supported
    3. Click view data on one of the tables and data is displayed.
    4. Created a physical join
    5. Created new Business Model
    6. Created two logical tables (one fact and one dimension)
    7. Joined logical tables (inner join)
    8. Created new subject area by dragging business model over
    9. Saved and validated
    10. Started test server
    11. Queried new MySQL table and get the following error:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16023] The ODBC function has returned an error. The database may not be available, or the network may be down. (HY000)
    SQL Issued: SELECT "Ministry Person"."Account Number" saw_0 FROM "CRS" ORDER BY saw_0
    Just figured out the issue but am posting this in case someone else encounters this issue: The issue was that I had installed the ODBC driver on my local PC but had not installed it on the Test server. Once we installed the driver on the Test Server it solved the issue.
    Edited by: BenS on Feb 27, 2013 12:46 PM

    See post...

  • How to create php/apache/mysql installer with AIR

    Dear Flexer,
    I'd like to use AIR to create my own web tools installer (like mamp, wammp...).
    But I have no idea how to do that.
    Can you help me?
    Thanks

    There's a tutorial here:
    http://www.php-mysql-tutorial.com/wikis/php-tutorial/installing-php-and-mysql.aspx
    That said, why go through all the trouble? There are a number of applications out there than install and configure Apache, PHP, and MySQL for you.

  • Problems with Apache PHP Mysql

    I tried doing an upgrade from Tiger to Leopard server but was having lots of issues while working with the virtual sites I have hosted. I tried a clean install and I was still unable to get Apache php and mysql to work together. Each service was starting fine but when I would try to run a php file it would only display a white page. Under the upgrade instead of displaying the page it was downloading any page I tried to load.
    In the new clean install I enabled phplib5 through server admin but even a simple info.php file with <?php phpinfo(); ?> was only giving me a white page. I dont know if mysql was interfacing with php and apache at this point cause I could not get any further. I mainly just want to be able to run wordpress which is a php blog that uses a mysql database.
    I have heard some people talking about mamp installs and not using the stock web services but I did not know if that would be a smart route to take.

    well the problem come in that you could end out with multiple releases of the same application when the idea is to make one package "stable"
    would you rather have a debain package data base that has seventeen apache's or one stable full featured apache?
    as for a server/stable tree for production machines this is coming. implimentation is not the trouble it is time that is a factor.

  • PHP/MySQL access denied=restricted+area

    We just migrated to a new OS X Tiger running WebSTAR 5.4,
    w/MySQL 4.1.x, PHP 4.4.0 (I'm a bit vague on the MySQL version and
    am having trouble logging in via terminal to check).
    All my previous login pages set up using DWMX 2004 now refuse
    to redirect to the intended page when I use the correct username
    and password (URL returns
    "degree_login.php?accessdenied=Restricted+Area"). FWIW,
    deliberately typing the wrong username and/or password correctly
    yields the error page. So it seems something is working but not the
    login w/correct user/pwd.
    I know MySQL 4.x changed the password system so that they're
    encrypted, and I fixed this using the MySQL manual instructions
    (old password). But I don't see this as being related to my current
    problem.
    Since I'm really stymied as to where to start, and wondering,
    based on the error in the URL, what anyone might suggest to look
    for. I'm assuming it's still a permissions issue with the MySQL
    table, but I'm not sure why this would be the case. FYI, related
    pages that use the same database, but different table, still work
    fine. Any suggestions greatly appreciated.

    What those error messages are saying is that PHP can't connect to the database.
    This is because it's told to communicate with MySQL via /var/mysql/mysql.sock, but MySQL isn't listening there.
    That could be because your MySQL server is configured differently. Check /etc/my.cnf to see where the server is listening. You can read this file with any application that can open text files - no terminal experience necessary (although if you want to use the terminal, it's simply - 'cat /etc/my.cnf' and look for the 'socket' lines)
    If I reinstall MySQL, will I lose the data in my database?
    That depends, but it is not something you need to do at all, so don't worry about it.
    I read somewhere that I need to edit a file called /var/lib/mysql/mysql.sock, but how do I get to this file in order to edit it? I can't find it anywhere? I've been told it's a "hidden" file, but no-one has told me WHERE it's hidden!
    Red herring. Ignore whatever you read. In either case it's telling you WHERE you need to look - /var/lib/mysql/ but that isn't relevant here.

  • Where to go next with Dreamweaver and server-side (php/mysql) applications?

    This question is mainly directed at David Powers but  I appreciate any input from anyone with the same concern or question.
    I've been using DW since the change from Macromedia and have developed a number of applications using built in server behaviors and sb extensions from ADDT, WebAssist, etc. I've learned to customize these behaviors to fit my needs always keeping within the "canned" code. In this way I've "learned" php.
    I own most of David's books and in fact, it was because of these that I have any idea about what I'm doing and went in this direction in my "developer" career (building php/mysql applications using Dreamweaver.)
    With the decision to remove server behaviors (and the other "developer" panels) from DW and with the deprecation of the mysql extension from the php landscape, I'm wondering where to go next? I fully understand this has to happen.
    I'm aware of some alternatives:
    Zend or some other framework - to me, this seems extremely complex
    Keep several versions of DW installed
    Stick to Joomla/WordPress/Drupal - let others who know what they're doing build the architecture
    Actually LEARN php - wish I had time; too much work to do (I know how illogical that sounds but it's a very real situation)
    I know I'm going to have to switch out all that deprecated code or better yet, rebuild the many applications which used the DW (and other) server behaviors. I'm just not sure which way to turn.

    rjjacob wrote:
    Since I wrote this post I concluded that there is no substitute for understanding and have started my re-education by delving further into the issue with updated PHP/MySQL books and tutorials so I can prepare for a Dreamweaver without this functionality.
    Yes, I too have concluded that is the way to go as well. There really is no substitute for learning as much as you can. Whilst the DW Server Behaviours were very convenient they have not kept pace, Adobe prefering to spent their time on less important updates in my opinion. The Server Behaviours are what makes Dreamweaver the tool of choice  for database integration for those who lack the knowledge. I feel the Adobe team will regret not coming up with an alternative. Anything that detracts from making the program what it is is a step in the wrong direction and for sure this is a big step in the wrong direction.
    rjjacob wrote:
    I have mainly used DW server behaviors in my development projects that's why I am curious about what others are doing to make the change. I'm surprised there haven't been more posts; perhaps I'm the last one to be taking action about this, or maybe no one is too worried about it yet.
    I think a lot have changed their working practice but many more are burying their heads in the sand. sql_ support is a way off from being completely dropped yet.
    rjjacob wrote:
    Anyway, your assessment of how terrible the server behaviors are is correct. I'm finding that true after barely breaking the binding on a few books about the greater subject and looking into mysqli and PDO.
    Yes, because I relied heavily on them I did not know how bad they were until I forced myself to look further afield. What you can do in a couple of lines of code the DW Server Behaviors produced quadruple or more to achieve the same.
    rjjacob wrote:
    But they sure were convenient!
    Yes, I agree. Maybe some extention developer will come up with a set of new improved behaviours. I tell you if they do they will make a shed load of money.

  • Help in establishing connection to php and mysql data base.

    Hi,
    i have been trying to execute a simple flash program that communicates with a php page which is linked to a mysql database.
    somehow the php is not returning any data to flash , and even falsh is not sending any data to php.. I am using wamp server on win7.
    Heres my actionscript code:
    stop();
    var variables:URLVariables = new URLVariables();
    var varSend:URLRequest = new URLRequest("php.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    var varLoader:URLLoader = new URLLoader;
    //varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.dataFormat = URLLoaderDataFormat.TEXT;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    variables.requestCode = "homepage";
    //variables.myRequest="homepage";
    trace(variables);
    varLoader.load(varSend);
    function completeHandler(event:Event):void
        trace(event.target.data.t_passed);
        var t_recieved = event.target.data.t_passed;
        //t_txt.text = "t_passed";
        t_txt.text=t_recieved;
    try
        varLoader.load(varSend);
    catch (error:Error)
        trace("error");
    And this is my php 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>
    <?php
    //error_reporting(E_ALL  & ~E_NOTICE);
    $connection=mysql_connect("localhost" , "root" , "");
    if(!$connection)
        die("failed".mysql_error());
    $db_select = mysql_select_db("questions",$connection);
    if (!$db_select)
        die("failed".mysql_error());
        if ($_POST['requestCode'] == "homepage") {
        $pageName = $_POST['requestCode'];
        echo ($_POST['requestCode']);
    $result=mysql_query("select q from quest where qno=111",$connection);
    while($row=mysql_fetch_array($result))
    $t=$row[0];
    //print "t_passed = $s";
    echo "t_passed=".$t;
    mysql_close($connection);
    ?>
    </head>
    <body>
    </body>
    </html>
    The php gives me Undifined notice for the 'requestCode' variable...
    please help..
    Thanks in advance

    Sample Flash Code:
    package
        import flash.display.*;
        import flash.events.*;
        import flash.net.*;
        import flash.text.*;
        public class sendtophp extends Sprite
            var phpFile:String = "http://localhost/Raja/sendDataToServer.php";
            public function sendtophp():void
                callBtn.addEventListener(MouseEvent.CLICK, callServer);
            function callServer(e:MouseEvent):void
                var urlRequest:URLRequest = new URLRequest(phpFile);
                var urlParams:URLVariables = new URLVariables();
                urlParams.country = "India";
                urlParams.animal="Tiger";
                urlRequest.method = URLRequestMethod.POST;
                urlRequest.data = urlParams;
                var loader:URLLoader = new URLLoader();
                loader.addEventListener(Event.COMPLETE, serverResponse);
                loader.load(urlRequest);
            function serverResponse(e:Event):void
                trace("loaded");
                var loader:URLLoader = URLLoader(e.target);
                var variables:URLVariables = new URLVariables(loader.data); 
                responseTxt.text = variables.returnValue; 
        }//end of class sendtophp 
    }//end of package
    Sample PHP code:
    <?php
    print "returnValue= Hi ".$_POST['country'].", it's working";
        $host = "localhost";
        $user = "root";
        $pass = "";
        $db = "test";
        $country = $_POST['country'];
        $animal = $_POST['animal'];
         $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
         mysql_select_db($db) or die ("Unable to select database!");
          $query = "INSERT INTO symbols (country, animal) VALUES ('$country', '$animal')";
          $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
        echo "New record inserted with ID ".mysql_insert_id();
           mysql_close($connection);
    ?>
    I had tested and it works fine. Please have this as an sample. If you have any clarification then reply to the thread

  • Insert not working in php to mysql

    Ive been trying to enter information into mysql for the longerst. My guess is the sql statement. But if anybody can find anything wrong please tell me
    Heres my database
    and heres my code
    please help

    Can you try this in your insert.php (its mysqli rather than mysql)
    <?php
    $NameofOrganization = $_GET['NameofOrganization'];
    $Tickets = $_GET['Tickets'];
    $OriginalPrice = $_GET['originalprice'];
    $DiscountedPrice = $_GET['DiscountedPrice'];
    $Date = $_GET['Date'];
    $Time = $_GET['Time'];
    $Email = $_GET['Email'];
    $Description = $_GET['Description'];
    $Event_name = $_GET['event_name'];
    $con=mysqli_connect("localhost", "root" , "", "user_registration");
    // Check connection
    if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    mysqli_query($con,"INSERT INTO events (name_organization, event_name, number_of_tickets, orginal_price, discounted_price, date, time, email,description) VALUES('$NameofOrganization' , '$Event_name', '$Tickets', ' $OriginalPrice', '$DiscountedPrice', '$Date', '$Time', '$Email', '$Description' )");
    ?>
    Below is the mysql version for insert.php:
    <?php
    $NameofOrganization = $_GET['NameofOrganization'];
    $Tickets = $_GET['Tickets'];
    $OriginalPrice = $_GET['originalprice'];
    $DiscountedPrice = $_GET['DiscountedPrice'];
    $Date = $_GET['Date'];
    $Time = $_GET['Time'];
    $Email = $_GET['Email'];
    $Description = $_GET['Description'];
    $Event_name = $_GET['event_name'];
    ?>
    <?php
    // Make a MySQL Connection
    mysql_connect("localhost", "root", "") or die(mysql_error());
    mysql_select_db("user_registration") or die(mysql_error());
    // Insert a row of information into the table "events"
    mysql_query("INSERT INTO events
    (name_organization, event_name, number_of_tickets, orginal_price, discounted_price, date, time, email,description) VALUES('$NameofOrganization' , '$Event_name', '$Tickets', ' $OriginalPrice', '$DiscountedPrice', '$Date', '$Time', '$Email', '$Description') ")
    or die(mysql_error()); 
    ?>

  • Using php-mysql module and Apache2.2 provided with FMS4.5

    Hi,
    we've recently downloaded and upgraded FMS from 3 to 4.5 on a server that has this configuration (before upgrading):
    - Centos 5.5
    - Apache 2.2.3
    - mysql 5.0.77
    - php 5.3.3
    - perl 5.8.8
    Everything was fined before upgrading since 3 years.
    We decided to upgrade FMS to provide HLS to our customers.
    Once we upgraded FMS and installed Apache that comes with the installer, we encountered lots of errors.
    - no more php, all scripts were visible, so we had to reinstall php module; and by the way, how can't we have the logical directories for apache (like /etc/httpd/,...) instead of /opt/adobe/fms/Apache...
    - no more perl, cgi script are also visible...
    - and now, we are unable to connect to mysql database. Whatever we do, the following message appears:
    Fatal error:  Call to undefined function mysql_connect()
    modules are in the right folders but no way....
    If someone can help us,
    regards,
    Tony

    i answer to myself:
    I finally managed to do it.
    The best way was this:
    - backup the Apache folders from fms
    - reinstall fms w/o apache
    - reinstall properly the standard httpd ( i launched yum remove httpd before)
    - copy modules from fms backup to /etc/httpd/modules  so i havve specific modules
    - update httpd.conf with adobe version (easy with Kompare)
    restart httpd and fms
    Now everything works well: php, mysql, cgi, ...

Maybe you are looking for

  • No sound with alsa on IBM Thinkpad R50e / Intel 82801DB-ICH4

    I'm having trouble getting sound working on a new install of Arch on an IBM Thinkpad R50e. Here are some details: $ sudo pacman -Ss alsa extra/alsa-firmware 1.0.25-2 [installed] ALSA firmware package extra/alsa-lib 1.0.25-1 [installed] An alternative

  • Almost afraid to ask... Where are my Lightroom files?

    I've upgraded to LR3 from 2 and in the process Lightroom has chosen to create a new catalog, or at least I think that's the proper term. What was 'Name' catalog with all of my images is now 'Name-2' with all of my images. What happened to the simple

  • Create new sub-element (Service reference) SICF

    Hello Friends, I have created a new BSP extension. Now i want to add this into SICF...as a sub element... while trying to do this...it is throwing a error that "no authorization"... My user is having "SAP_ALL" profile too... Please help me, what are

  • MySQL - importing excel database

    Hello, When I try to import a excel database file into SQL I keep gettng a #1046 Syntax error. Can someone help explain how to fix this. Does this mean that the field names in excel are not understood by SQL? If so, how do you get the data in there.

  • Segmentation in CRM Marketing - Using customer hierarchy in BI query

    Hi all, We are using segmentation in CRM 7.0. As part of this we are creating DataSources based upon BI queries. This works fine when we create queries with 0CUSTOMER in the rows. However when we assign a hierarchy to 0customer in the query designer,