Export as CSV - php mysql

Hi can anyone tell me if there is a way to export a table or tables as XL, CSV etc
Thanks
Bert

Below is the script i use in a PHP file to export the contents of a table to an excel file.
<br /><?php require_once('PATH TO CONNECTION FILE'); ?>//Connection string
<br /><?php<br />if (!function_exists("GetSQLValueString")) {<br />function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") <br />{<br />  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;<br /><br />  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);<br /><br />  switch ($theType) {<br />    case "text":<br />      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />      break;    <br />    case "long":<br />    case "int":<br />      $theValue = ($theValue != "") ? intval($theValue) : "NULL";<br />      break;<br />    case "double":<br />      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";<br />      break;<br />    case "date":<br />      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />      break;<br />    case "defined":<br />      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;<br />      break;<br />  }<br />  return $theValue;<br />}<br />}<br />mysql_select_db($database_write, $write);//username<br />//Start of query <br />$select = "SELECT LIST FIELDS  FROM NAME OF TABLE";//enter query between s<br />//End of query<br />$export = mysql_query ( $select ) or die ( "Sql error : " . mysql_error( ) );<br /><br />$fields = mysql_num_fields ( $export );<br /><br />for ( $i = 0; $i < $fields; $i++ )<br />{<br />    $header .= mysql_field_name( $export , $i ) . "\t";<br />}<br /><br />while( $row = mysql_fetch_row( $export ) )<br />{<br />    $line = '';<br />    foreach( $row as $value )<br />    {                                            <br />        if ( ( !isset( $value ) ) || ( $value == "" ) )<br />        {<br />            $value = "\t";<br />        }<br />        else<br />        {<br />            $value = str_replace( '"' , '""' , $value );<br />            $value = '"' . $value . '"' . "\t";<br />        }<br />        $line .= $value;<br />    }<br />    $data .= trim( $line ) . "\n";<br />}<br />$data = str_replace( "\r" , "" , $data );<br /><br />if ( $data == "" )<br />{<br />    $data = "\n(0) Records Found!\n";                        <br />}<br /><br />header("Content-type: application/octet-stream");<br />header("Content-Disposition: attachment; filename=FILENAME GOES HERE.xls");//This is the name the file will be exported with<br />header("Pragma: no-cache");<br />header("Expires: 0");<br />print "$header\n$data";<br /><br />?>
<br />
<br />Hope this helps

Similar Messages

  • Export Data as CSV - PHP/MySQL

    Hi, is it possible to export MySQL data as CSV using developer toolbox? My PHP knowledge is very basic so please be gentle.
    Thanks
    Bert

    Hi Bert,
    no, ADDT doesn´t provide this feature, but there are quite some other extensions out there to export results from a recordset as CSV -- guess you´ll find some listed in the Dreamweaver Exchange.
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • PHP/MySQL Test/Production Server best practices

    Hello,
         I am currently learning PHP/MySql and have setup a test server to develop on and a production server to go live with. I wanted to know what are the best practices for synchronizing the test server with the production. Should I export the database from the test server and import it to the production server each time I make a change or is there better way to incrementally sync the databases. I am using Dreamweaver to design the web site.
    Thanks,
    Nick

    Thanks, but does this mean that after I go live I should make changes on the production database only and not use the development database, if say I need to add a new table or record(s)?
    Procedure
    1. Take production web site down
    2. Export/Save current database
    3. Make changes to production database
    4. Export/Save new database
    5. Bring production web site up
    Is this correct?

  • Taking my PHP/MySQL site online - how?

    Hi,
    Once I have developed a site on my local PC in DW, utilizing
    PHP and MySQL Administrator, how do I make it work online?
    Obviously I need to use the built-in FPT function in DW - but
    how do I transfer the database files to the server?
    I have searched for an anser to this question for a long time
    - but all the tutorials I find (and I have found a number!) help me
    develop my site locally - and then say nothing about taking it
    online.
    I have developed a number of sites using ASP/Access. When I
    take such a site online, I need to change the connection-string. Is
    the process the same for PHP/MySQL sites? If yes, what change do I
    need to make? And what database-file do I upload to the server, and
    where do I put it?
    Here is where I want to get: I want to have my site locally,
    so that I can make any changes to it when necessary - and then
    upload it so that it now uses the online database. ASP/Access
    allowed me to have both locally, so that I could make any changes.
    Downside is of course you have two versions of the database, one
    local, one remote.
    My host uses PHPMyAdmin. I see I can download a version of
    this and use it locally. Should I do that and use that? Does it do
    the same as PHP Administrator?
    As you can see I have many questions. I think I am missing a
    few key-thoughts that will help me understand PHP and MySQL and
    make go "oh, now I get it!'
    Please feel free to point me to tutorials that you believe I
    will find helpful.
    Thanks for your help in advance!
    Rogier

    RogierBos wrote:
    > Hi,
    >
    > Once I have developed a site on my local PC in DW,
    utilizing PHP and MySQL
    > Administrator, how do I make it work online?
    >
    > Obviously I need to use the built-in FPT function in DW
    - but how do I
    > transfer the database files to the server?
    >
    > I have searched for an anser to this question for a long
    time - but all the
    > tutorials I find (and I have found a number!) help me
    develop my site locally -
    > and then say nothing about taking it online.
    > I have developed a number of sites using ASP/Access.
    When I take such a site
    > online, I need to change the connection-string. Is the
    process the same for
    > PHP/MySQL sites? If yes, what change do I need to make?
    And what database-file
    > do I upload to the server, and where do I put it?
    >
    > Here is where I want to get: I want to have my site
    locally, so that I can
    > make any changes to it when necessary - and then upload
    it so that it now uses
    > the online database. ASP/Access allowed me to have both
    locally, so that I
    > could make any changes. Downside is of course you have
    two versions of the
    > database, one local, one remote.
    >
    > My host uses PHPMyAdmin. I see I can download a version
    of this and use it
    > locally. Should I do that and use that? Does it do the
    same as PHP
    > Administrator?
    >
    > As you can see I have many questions. I think I am
    missing a few key-thoughts
    > that will help me understand PHP and MySQL and make go
    "oh, now I get it!'
    >
    > Please feel free to point me to tutorials that you
    believe I will find helpful.
    >
    > Thanks for your help in advance!
    >
    > Rogier
    >
    Sounds like you need to export your database and then import
    it into
    your production server. Then upload the website, adjust the
    connection
    string so that its pointing to the correct server with the
    correct
    credentials and away you go.
    Steve

  • 10g exporting to CSV using client_text_io is not working correctly.

    I have an odd issue which i could do with some help with. I run an function that exports to CSV based on an pre defined record group.
    This has been working fine for many months with various customers. Recently a new customer used it and they have 28k rows in his record group and the export is actually not exporting correctly.
    The record group has a record count of 28331.
    The CSV produced has only 3756 in my CSV file. These are the last 3756 records in the Record group so its as if its overwriting the data as it goes yet all smaller datasets work
    FUNCTION fun_export_csv (vgraphid NUMBER, p_filename VARCHAR2)RETURN BOOLEAN IS
      out_file                      client_text_io.file_type; 
         i                                             NUMBER;
      lv_line              VARCHAR2(5000);
    BEGIN
    rg:=populate_group('RG11_EXP');               
    synchronize;
    lv_line:= ('"GIN","Gin Date","PO Num","PO Required Date","Mat Num","Mat Description","Supplier Part No","On Time Delivery(Yes-1, No-0)"');
    client_text_io.put(out_file, lv_line);
    client_text_io.new_line(out_file,1); 
    For i in 1..get_group_row_count('RG11_EXP') Loop--this count is 28331
    lv_line:= ('"'||get_group_number_cell('RG11_EXP.col1', i )                 ||'"'|| ',' ||'"'||
         get_group_date_cell('RG11_EXP.grn_date', i )                 ||'"'|| ',' ||'"'||                                          
         get_group_number_cell('RG11_EXP.po', i )       ||'"'|| ',' ||'"'||
         get_group_date_cell('RG11_EXP.daterqd', i ) ||'"'|| ',' ||'"'||
         get_group_char_cell('RG11_EXP.item_no', i ) ||'"'|| ',' ||'"'||
         get_group_char_cell('RG11_EXP.desc', i )                    ||'"'|| ',' ||'"'||
         get_group_char_cell('RG11_EXP.part_no', i )               ||'"'|| ',' ||'"'||
         get_group_number_cell('RG11_EXP.ontime', i )                    ||'"');
    client_text_io.put(out_file, lv_line);
    client_text_io.new_line(out_file,1); 
    END LOOP;     
    client_text_io.FCLOSE(out_file);
    RETURN TRUE;          

    Hello,
    Try to insert a "synchronize" instruction from time to time:
    i  pls_integer := 1;
    Loop
      If mod(i, 500) = 0 Then
         synchronize;
      End if ;
      i := i + 1 ;
    End loop;
    ...<p>But keep in mind the the CLIENT_TEXT_IO generate a lot of network traffic, so it is better and faster to generate the file on the A.S., then after transfer it to the client machine.</p>
    Francois

  • How export to csv work in safari browser? In my application export to csv open like a raw data in new tab. But other browsers working great!. Need to open in a csv file or save it as a csv file.

    How export to csv work in safari browser?
    In my application export to csv open like a raw data in new tab.
    But other browsers working great!.
    Need to open in a csv file or save it as a csv file.
    Please suggest me. Thank you in advance!.

    Hi Adrian,
    Why don't you try any another software for opening CSV files then Notepad ? According to my experience, you can use these softwares to open an CSV files and they are:-
    Microsoft Excel
    Open Office Calc
    Google Docs
    Also there is an additional tool available known as CSV viewer. You may try this, download it from here http://www.csvviewer.com/
    I've never used Notepad for opening CSV files, because sometimes it contains some symbols which are not not at all compatibile with Notepad.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Hide column in SSRS is not working while exporting to CSV format.

    Hi,
    I have a report where some columns are hidden based on parameter value. When I export to Excel all the hidden columns are hiding which is fine, but the issue is when I exported to CSV all the hidden columns are exporting to csv.
    I tried to using  " =IIF(Globals!RenderFormat.Name = "CSV", True,False)" in Column visibility but It is not working. When I select Hide option it is working fine. But I want to hide based on expression.
    Any help !!!!!!!!

    Hi sumancv,
    In SQL Server Reporting Services (SSRS), we can control whether an item is visible in CSV separately from whether an item is visible in other renderers. As Shahfaisal Muhammed posted earlier, the CSV renderers use the DataElementOutput property to control
    visibility. When an item has DataElementOutput=Output, it will appear in the CSV.  When an item has DataElementOutput=NoOutput, it will not appear in CSV.
    Based on my test, we cannot use expression to control column visibility in the report when it is export to CSV.
    Reference:
    http://connect.microsoft.com/SQLServer/feedback/details/742658/ssrs-csv-export-issue-for-hiding-certain-columns-using-expressions
    Since the issue is by design, I recommend you that submit a wish to the Microsoft Connect at
    https://connect.microsoft.com/SQLServer/Feedback. Your feedback is valuable for us to improve our products and increase the level of service provided.
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • Report output Export to CSV issue

    Hi Experts,
    I have a Bex Query. After running the report when I export the report in CSV format using "Export to CSV" from the report output screen, the data
    is being dumped in different columns And when i try to convert that particular CSV file to Excel as we can only select one single column for delimiting the values using a separator into different cells the data in the other column is being truncated.
    Kindly suggest me how to resolve this.
    Thanks in Advance,
    Sushma

    Hi,
    (If anything else on the BW side doesn't help).
    Not so long ago I had a similiar problem all data (originally taken from several columns) were in one column - solved it with the help of VB coding.
    Sth like this could help you.
    Regards, Leszek
        Dim tekst As String
        last_row = Selection.SpecialCells(xlCellTypeLastCell).Row
        Range("A1:Z" & last_row).Select
        Cells.Select
        Selection.NumberFormat = "@"
        For wiersz = 1 To last_row
             Cells(wiersz, 1).Select
             tekst = Selection.Value
             Cells(wiersz, 1).Value = Left(tekst, 21)
             Cells(wiersz, 2).Value = Right(Left(tekst, 27), 6)
             Cells(wiersz, 3).Value = Right(Left(tekst, 37), 10)
             Cells(wiersz, 4).Value = Right(Left(tekst, 50), 13)
        Next wiersz

  • 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!

  • Show if field is not empty - PHP/MySQL

    Is there a way I can only show bits of a page if a recordset
    has entries in a certain field, automatically hiding the area if
    the field is empty. (PHP/MySQL)
    To put it in real terms, I have loads of products listed in a
    repeating table. If a product has a photo gallery related to it
    there is a 1 entered in 'photos' field, it has a video attached
    here is a 1 entered in 'videos field and likewise for reviews it
    will have a 1 entered in the reviews field.
    What I'd like to have is a photo, video and review icon/link
    in the 'master table' which only appears in the repeated products
    that have a 1 listed in that field and have them not appear at all
    when there is a 0 in the field.
    Can anyone help me figure it out

    ADDT is certainly a great help, as it - among many other
    features - will allow you define whatever page element as
    "show/hide" based on a query result -- for this it´s using a
    so-called "condition builder" which lets you do that without
    coding.
    However you can achieve the same result without needing to
    resort to ADDT -- by using a basic "if" condition that´s
    checking the respective table column for having the value "1"
    stored, and if so, display the page segment
    The following 3 examples should work when replacing the
    sample "queryname" with the query name your page is actually using:
    <?php if ($row_queryname['photos'] == '1') {?>
    display photo icon here
    <?php }?>
    <?php if ($row_queryname['videos'] == '1') {?>
    display video icon here
    <?php }?>
    <?php if ($row_queryname['reviews'] == '1') {?>
    display videos icon here
    <?php }?>

  • After installed SP1 for SQL Server 2012, can no longer export to csv

    After installing SP1 today via Windows Update, I am no longer able to export data to csv using the SQL Server Import and Export wizard. I get the following error message:
    "Column information for the source and the destination data could not be retrieved, or the data types of source columns were not mapped correctly to those available on the destination provider."
    "Column "col1": Source data type "200" was not found in the data type mapping file."...
    (The above line repeats for each column)
    The work-around I have to do is to manually map each column in the "Edit Mappings..." option from the "Configure Flat File Destination" page of the wizard. This is an extreme inconvenience to have to have to edit the mappings and change
    each column to "string [DT_STR]" type from "byte stream [DT_BYTES]" type each time I want to export to csv. I did not have to do this before installing SP1; it worked perfectly for months with hundreds of exports prior to this update and
    no need to modify mapping.

    I am running Windows 7 64-bit, SQL Server 2012 Express edition. Again, just yesterday from Windows Update, I installed SQL Server 2012 Service Pack 1 (KB2674319), followed by Update Rollup for SQL Server 2012 Service Pack 1 (KB2793634). This situation was
    not occurring before these updates were installed, and I noticed it immediately after they were installed (and of course I restarted my computer after the updates).
    In SSMS I just now created a test DB and table to provide a step-by-step with screenshots.
    Here is the code I ran to create the test DB and table:
    CREATE DATABASE testDB;
    GO
    USE testDB;
    GO
    CREATE TABLE testTable
    id int,
    lname varchar(50),
    fname varchar(50),
    address varchar(50),
    city varchar(50),
    state char(2),
    dob date
    GO
    INSERT INTO testTable VALUES
    (1,'Smith','Bob','123 Main St.','Los Angeles','CA','20080212'),
    (2,'Doe','John','555 Rainbow Ln.','Chicago','IL','19580530'),
    (3,'Jones','Jane','999 Somewhere Pl.','Washington','DC','19651201'),
    (4,'Jackson','George','111 Hello Cir.','Dallas','TX','20010718');
    GO
    SELECT * FROM testTable;
    Results look good:
    id    lname    fname    address    city    state    dob
    1    Smith    Bob    123 Main St.    Los Angeles    CA    2008-02-12
    2    Doe    John    555 Rainbow Ln.    Chicago    IL    1958-05-30
    3    Jones    Jane    999 Somewhere Pl.    Washington    DC    1965-12-01
    4    Jackson    George    111 Hello Cir.    Dallas    TX    2001-07-18
    In Object Explorer, I right-click on the [testDB] database, choose "Tasks", then "Export Data..." and the SQL Server Import and Export Wizard appears. I click Next to leave all settings as-is on the "Choose a Data Source" page, then on the "Choose a Destination"
    page, under the "Destination" drop-down I choose "Flat File Destination" then browse to the desktop and name the file "table_export.csv" then click Next. On the "Specify Table Copy or Query" page I choose "Write a query to specify the data to transfer" then
    click Next. I type the following SQL statement:
    SELECT * FROM testTable;
    When clicking the "Parse" button I get the message "This SQL statement is valid."
    On to the next page, "Configure Flat File Destination" I try leaving the defaults then click Next. This is where I am getting the error message (see screenshot below):
    Then going to the "Edit Mappings..." option on the "Configure Flat File Destination" page, I see that all columns which were defined as varchar in the table are showing as type "byte stream [DT_BYTES]", size "0", the state column which is defined as char(2)
    shows correctly however with type "string [DT_STR]", size "2" (see screenshow below):
    So what I have to do is change the type for the lname, fname, address and city columns to "string [DT_STR]", then I am able to proceed with the export successfully. Again, this just started happening after installing these updates. As you can imagine, this
    is very frustrating, as I do a lot of exports from many tables, with a lot more columns than this test table.
    Thanks for your help.

  • PHP/Mysql issue

    I use Dreamweaver CS3 to create my sites on a Windows/Apache
    Server with PHP5 and Mysql 5. The site works perfectly on my
    testing server at home. On the Web server I'm getting the following
    error which causes the page to not load:
    PHP Warning: mysql_query(): supplied argument is not a valid
    MySQL-Link resource in
    /hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
    on line 63
    PHP Warning: mysql_select_db(): supplied argument is not a
    valid MySQL-Link resource in
    /hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
    on line 61
    The lines in question are:
    Line 61 - mysql_select_db($database_conn_phh, $conn_phh);
    $query_getSuccess = "SELECT * FROM horses WHERE status =
    'Success Story' ORDER BY horse_barn ASC";
    $getSuccess = mysql_query($query_getSuccess, $conn_phh) or
    die(mysql_error());
    $row_getSuccess = mysql_fetch_assoc($getSuccess);
    $totalRows_getSuccess = mysql_num_rows($getSuccess);
    All of the code is supplied by Dreamweaver. I did not tweak
    the code. I'm not a web developer and what I have found out there
    is still reading greek to me. My connection file is working and
    connecting the database that I have tested.
    Since the above code is throughout the site in one form or
    another it's causing me major headaches. Any help would be
    appreciated.

    This is the first time I've used Adobe products so if the
    following is in the wrong forum (It's the closest one I found so
    far) or the format is incorrect please forgive me.
    I'm new to Dreamweaver CS3 and as I was reading the "first
    steps" it mentions to set up a Dreamweaver site right away. I got
    as far as completing "Site Definition" page under the basic side of
    the setup screen.
    The next screen is "Do you want to work with server
    Technology?"
    There are 2 options - Yes or No. If you select yes a
    drop-down menu appears with several options (but you can only
    select one)...
    Asp Javascript
    Asp VbScript
    Asp.net#
    Asp.net Vb
    Cold Fusion
    JSP
    Php MySql.
    I know nothing about these format and brand new to web design
    so I thought it best to contact GoDaddy (my hosting account) to
    find out what their servers would support. I spoke to a tech rep
    but she wasn't sure.
    She did mention that I have a windows hosting account and Php
    MySql would not work unless I changed to their Linux platform at no
    additional charge.
    The site I have in mind will design with CSS, Liquid layout,
    have some flash, widgets, an inquiry form that clients complete and
    results e-mailed to me, auto-responder, Paypal link and whatever
    else I can discover from Dreamweaver.
    My question being:
    I haven't even begun designing my site because I do not know
    what weather I should select the Yes option and select one of the
    formats mentioned above (if so which one) - or select the No
    option. If I do select the No option at the very beginning, will I
    have problems with my site uploading and working correctly?
    Thank you
    Travis

  • PHP/MySQL issue after security update 2010-005

    Hello,
    I run Apache/PHP/MySQL on my MBP for testing Web sites.
    After the 2010-005 security update I can't connect to my databases anymore.
    I don't know how to fix this, I even don't know where to start looking.
    Ideas, anyone?

    coloma wrote:
    etresoft, thanks for sharing this ... I decided to go with the TriangleJuice suggestion instead for two reasons ... first is that I wasn't sure where to find this launchd file.
    There is nothing wrong with TriangleJuice's suggestion. My only issue with creating a php.ini file is that now I have to worry about all those other settings in the ini file. If something else in PHP breaks, I have to figure out if I am the one who broke it.
    Apple ships MySQL with MacOS X Server. They probably adjusted the PHP settings to match how they have MySQL setup in MacOS X Server.
    For MySQL's, no, Sun's - drat! no, Oracle's part, they still haven't acknowledged the fact that Apple has shipped MacOS X 10.4. MySQL still ships with a Startup Item. If you don't know where the launchd file is, it is because you don't have one. You probably have a MySQL entry in /Library/StartupItems or maybe /System/Library/StartupItems. Startup Items were deprecated in 10.4. Oracle should be creating a file named com.mysql.mysqld.plist in /Library/LaunchDaemons.
    Here is what mine looks like now:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/mysql/bin/mysqld</string>
    <string>--socket=/var/mysql/mysql.sock</string>
    <string>--basedir=/usr/local/mysql</string>
    <string>--datadir=/usr/local/mysql/data</string>
    <string>--user=mysql</string>
    <string>--log-error=/usr/local/mysql/data/Pele.local.err</string>
    <string>--pid-file=/usr/local/mysql/data/Pele.local.pid</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    </dict>
    </plist>
    I also don't have a /var/mysql directory and wasn't sure whether I should just create one or if this meant my configuration was different. If you feel like explaining any of this, I'd be curious to know.
    You have to create one. Such a directory probably already exists on MacOS X Server. Just make sure it is owned by mysql.
    sudo mkdir /var/mysql
    sudo chown _mysql:staff /var/mysql
    sudo chmod 0755 /var/mysql
    [jdaniel@Pele:516] /var $ ls -al /private/var | grep mysql
    drwxr-xr-x 3 _mysql staff 102 Aug 26 20:03 mysql
    Of course, /var is a symbolic link to /private/var. Long story there.

  • Using LIMIT function in PHP/MySQL Dreamweaver RecordSet

    I want to have a record set that skips the first record, and shows the next three. I've found several suggestions online to use the LIMIT function, but I keep getting "error in SQL syntax." What am I missing?
    mysql_select_db($database_adventcms, $adventcms);
    $query_rsSideNews = "SELECT * FROM tb_news LIMIT 1, 3 WHERE status = 'Live' ORDER BY `date` DESC";
    $rsSideNews = mysql_query($query_rsSideNews, $adventcms) or die(mysql_error());
    $row_rsSideNews = mysql_fetch_assoc($rsSideNews);
    $totalRows_rsSideNews = mysql_num_rows($rsSideNews);

    And there we go. That's the reason I need to go through PHP/MySQL training rather than relying on google searches!

  • Command in php / mysql

    Hello,
    I used to program a lot in ASP, and loved the command
    function.
    However, now that I'm programming in PHP I do not have this
    at my disposal unfortunately.
    How does everyone perform certain actions on forms right
    now?, for example I'm performing an update on a record, but want to
    update all records in the table first by setting a certain field to
    0.
    Any thoughts and ideas / samples are greatly
    appreciated!

    Jasmine2002 wrote:
    > Correct, in ASP however I had the command so I can later
    on easily call up the
    > box and change / add / update my SQL.
    >
    > Do you just write the appropriate PHP for it?, I don't
    really know how to
    > properly write this in conjuction with Dreamweaver.
    I suspect that command is probably a stored procedure.
    Unfortunately,
    stored procedures were added to MySQL only in version 5.0,
    and
    Dreamweaver doesn't support stored procedures in the PHP
    MySQL server
    model. (I've lobbied for support, but it hasn't happened
    yet.)
    Your update is rather unusual, but you should be able to get
    Dreamweaver
    to generate the code for you using the Update Record server
    behavior.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

Maybe you are looking for

  • Configure sso to non sap

    dear all, i would like implement sso from ep to other web application ( non SAP ) the legacy system is using " PHP and Web Server APACHE " there any want can help me how to configure the sso and how to create iview for my legacy system ( using URL iV

  • Airport only works on certain computers...

    I have two APX and two AX. Even if I use just one APX still only my 15in powerbook will have inernet. My other computers (G4 Cube, and two older iBooks) will recognize my network, but in the network status pane in system preferences it registers yell

  • Supplier Self Registration

    Hi, I am trying to develop a supplier self registration portal using SAP Sourcing (Wave 9). I am unable to edit the product categories on the supplier self registration portal. How can this be done? Is it possible to add / remove product categories f

  • Syntax checker

    Hi all, I wish to create a Custom Syntax checker for a String expression. This should incorporate small checks like count of "{" equals count of "}" so on and so forth. Is there a way[other than parsing the String using charAt() or indexOf()] that I

  • IPad stuck in recovery mode after iOS 7.1 update how do I fix this?

    How do I fix this ?????