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/

Similar Messages

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

  • Updating to 10.4.11 killed my PHP/MYSQL connections

    Hi all - I use Dreamweaver CS3 for web development, and have been using some very simple PHP/MYSQL Select and Inserts. Everything was working fabulously up until this morning, when I updated to 10.4.11 (Macbook Pro, CoreDuo). As soon as I updated, I get a 'No Database Selected' message in Safari, Firefox and IE. I can see the database and work with it in DWeaver, just can't get it to go live in browsers.
    I'm running PHP 5.2.4, MYSQL 5.1.8 and whatever version of Apache is bundled in OS X (I think it's 1.x - but can't find how to get that number!)
    Just for record, I have stopped/restarted Personal Web Sharing, Personal File Sharing, OS X, MYSQL to just check whether something wasn't working there.
    I'm about to close out, zap the PRAM and then come back in.
    Any ideas?
    Vince

    Thanks - A couple of additional points. This is OS X 10.4.11, not OS X Server, so I had installed MYSQL and PHP as fresh installations. MYSQL has not changed since I installed and is running fine through direct client (Navicat).
    For PHP I was running 4 and it had been running fine. When the update to OSX came through, PHP 4 didn't work - no change had been made to any configuration file that was working already. These are the httpd.conf instructions I had followed to set-up PHP 4:
    +1 Launch Terminal from /Applications/Utilities.+
    +2 Open the Apache configuration file and edit the UNIX shell prompt:+
    +sudo pico /etc/httpd/httpd.conf+
    +3 When prompted for a password, enter the Mac OS X administrator account password.+
    +4 Uncomment the following lines:+
    +LoadModule php4_module libexec/httpd/libphp4.so+
    +AddModule mod_php4.c+
    +5 Add the following lines (add these lines above: AddType application/x-tar .tgz):+
    +AddType application/x-httpd-php .php+
    +AddType application/x-httpd-php-source .phps+
    +Note: All the commands for the pico editor display on the screen and you can start any commands with the Control key. Use the arrow keys to move around. Pico is a text editor, mostly for UNIX users to use at the UNIX command line. The pico text editor resides in /usr/bin/ directory.+
    +6 Add a new index page for PHP (index.php) so that the web server will recognize it as the first page to load:+
    +<IfModule mod_dir.c>+
    +DirectoryIndex index.html index.php index.htm+
    </IfModule>
    +7 Save the httpd.conf file by pressing ^X (control & x keys). When the screen asks "Save Modified buffer?", press "Y". When prompted for "File Name to write : httpd.conf", press Return once to accept it. This will return you to the UNIX shell prompt.+
    When PHP 4 stopped working, I took the decision to upgrade to 5 and then fix the breakdown (by now, I was convinced it was an Apache change (nothing in config had changed at all). So, upgraded to PHP 5 and, to do so, had to reverse the directions above. Since then, I've tried reenabling the above, replacing with PHP5 wherever PHP4 appears, all to no avail (in fact, it just froze the Personal Web Sharing that turns Apache on/off).
    Right now, running the phpinfo check detailed above tells me the PHP 5 is successfully installed and running. The text from the test copied here:
    +System Darwin Vincet-MacBook-Pro.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386+
    +_Build Date_ Aug 31 2007 23:38:11+
    +_Configure Command_ './configure' '--prefix=/usr/local/php5' '--with-apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-iconv' '--with-openssl=/usr' '--with-zlib=/usr' '--with-gd' '--with-zlib-dir=/usr' '--with-ldap' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-snmp=/usr' '--enable-exif' '--enable-wddx' '--enable-soap' '--enable-sqlite-utf8' '--enable-ftp' '--enable-sockets' '--enable-dbx' '--enable-dbase' '--enable-mbstring' '--enable-calendar' '--enable-bcmath' '--with-bz2=/usr' '--enable-fastcgi' '--enable-cgi' '--enable-memory-limit' '--enable-zip' '--enable-pcntl' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-curl=shared,/usr/local/php5' '--with-mysql=shared,/usr/local/php5' '--with-mysqli=shared,/usr/local/php5/bin/mysql_config' '--with-pdo-mysql=shared,/usr/local/php5' '--with-libxml-dir=shared,/usr/local/php5' '--with-xsl=shared,/usr/local/php5' '--with-pdflib=shared,/usr/local/php5' '--with-imap=../imap-2004g' '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr/local/php5' '--with-png-dir=/usr/local/php5' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local/php5' '--with-iodbc=shared,/usr' '--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--with-t1lib=/usr/local/php5' '--with-gettext=shared,/usr/local/php5' '--with-ming=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/local/php5' '--with-mhash=shared,/usr/local/php5' '--with-mssql=shared,/usr/local/php5' '--with-fbsql=shared,/Users/liyanage/svn/entropy/universalbuild/src/FBDeveloper Libraries/Library/FrontBase' '--with-json=shared' '--enable-memcache' '--enable-openbase_module'+
    +_Server AP_I Apache+
    +_Virtual Directory Suppor_t disabled+
    +_Configuration File (php.ini) Path_ /usr/local/php5/lib+
    +_Loaded Configuration File_ /usr/local/php5/lib/php.ini+
    +_Scan this dir for additional .ini files_ /usr/local/php5/php.d+
    +_additional .ini files parsed_ /usr/local/php5/php.d/10-extension_dir.ini, /usr/local/php5/php.d/50-extension-curl.ini, /usr/local/php5/php.d/50-extension-fbsql.ini, /usr/local/php5/php.d/50-extension-gettext.ini, /usr/local/php5/php.d/50-extension-json.ini, /usr/local/php5/php.d/50-extension-mcrypt.ini, /usr/local/php5/php.d/50-extension-mhash.ini, /usr/local/php5/php.d/50-extension-ming.ini, /usr/local/php5/php.d/50-extension-mssql.ini, /usr/local/php5/php.d/50-extension-mysql.ini, /usr/local/php5/php.d/50-extension-mysqli.ini, /usr/local/php5/php.d/50-extension-odbc.ini, /usr/local/php5/php.d/50-extension-pdf.ini, /usr/local/php5/php.d/50-extension-pdo_mysql.ini, /usr/local/php5/php.d/50-extension-pdo_pgsql.ini, /usr/local/php5/php.d/50-extension-pgsql.ini, /usr/local/php5/php.d/50-extension-xsl.ini+
    +_PHP API_ 20041225+
    +P_HP Extension_ 20060613+
    +_Zend Extension_ 220060519+
    +_Debug Build_ no+
    +_Thread Safety_ disabled+
    +Zend Memory Manager enabled+
    +_IPv6 Support_ enabled+
    +_Registered PHP Streams_ zip, php, file, data, http, ftp, compress.bzip2, compress.zlib, https, ftps+
    +_Registered Stream Socket Transports_ tcp, udp, unix, udg, ssl, sslv3, sslv2, tls+
    +_Registered Stream Filters_ string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, bzip2.*, zlib.*+
    I don't know if any of this helps, but it's what I find. From my online troubleshooting and reading, I believe all of the above looks right and that things should work. So, I'm still left with an informed gut decision that something in the set-up of Apache changed (location in file structure, configuration file, etc.) Could it be looking at a second copy of httpd.conf somewhere else? That would seem to make sense - however I haven't managed to turn up how to assess which version of Apache is loaded (I think 1.3) or where it's located.
    If anyone can confirm what PHP5 code should be included in httpd.conf given the above, that would be a great next step.
    Thanks for all your assistance!
    Vince

  • 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 }?>

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

  • 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.)

  • How to use spry in the dreamweaver with the php/mysql

    hello,
    Iam new to the spry framework
    and i want to know can we use the spry in the dreamweaver
    along with php / mysql code
    if so please tell how to do this
    thanks in advance

    swetha123 wrote:
    > but when i complie this page it is not showing the
    preiew or any thing in the
    > browser i saved this page with the extension .php if i
    run the same page with
    > .html then i can see the design but it is not being
    executed
    The reason you get nothing when you save the page with a .php
    extension
    is because you have display_errors turned off, so you can't
    see the
    error message telling you there's a syntax error. The
    semicolon is
    missing at the end of this line:
    > echo "<font color='white'>Hello
    Swetha</font>"
    The reason it doesn't work with an .html extension is
    probably because
    you haven't uploaded SpryAssets/SpryTabbedPanels.js. I have
    copied your
    page and tested it locally with the correct JavaScript file,
    and the
    tabbed panels work as expected.
    There are lots of other mistakes in your page. You can't use
    float and
    position:absolute on the same element. In at least one place,
    you have
    used </br> instead of <br />. You have also got
    an closing paragraph tag
    after the paragraph that contains abc.jpg.
    Getting Spry or any other JavaScript library to work
    correctly relies on
    good, clean code. Your mixture of inline styles and font tags
    is going
    to make it difficult to incorporate Spry into your pages. I
    suggest you
    improve your HTML and CSS before bringing Spry into the mix.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Spry accordion with php mysql as data

    Hello
    I`m trying to create a spry accordion where the Labels are pulled from a mysql database table and the Content of that label is pulled from data in the same database. I tried adding first the spry accordion and then created 1 recordset for the labels and a second recordset for the content , then I added a repeat region for the labels DIV and inside this div I added a repeat region for the content.
    Unfortunatly when viewed in the browsers the accordion doesn`t work.
    Can anyone look at the code and tell me where is the mistake.
    Thanks
    <?php require_once('Connections/log.php'); ?>
    <?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;
    mysql_select_db($database_log, $log);
    $query_log_year = "SELECT DISTINCT Year(`23849`.acoff) AS yy FROM `23849` ORDER BY Year(`23849`.acoff)";
    $log_year = mysql_query($query_log_year, $log) or die(mysql_error());
    $row_log_year = mysql_fetch_assoc($log_year);
    $totalRows_log_year = mysql_num_rows($log_year);mysql_select_db($database_log, $log);
    $query_log_year = "SELECT DISTINCT Year(`23849`.acoff) AS yy FROM `23849` ORDER BY Year(`23849`.acoff)";
    $log_year = mysql_query($query_log_year, $log) or die(mysql_error());
    $row_log_year = mysql_fetch_assoc($log_year);
    $totalRows_log_year = mysql_num_rows($log_year);
    $mhour_log_mon = "0";
    if (isset($row_log_year['yy'])) {
      $mhour_log_mon = $row_log_year['yy'];
    mysql_select_db($database_log, $log);
    $query_log_mon = sprintf("SELECT DISTINCT DATE_FORMAT(`23849`.acoff, '%%M') AS mon , DATE_FORMAT(`23849`.acoff, '%%m') AS m , sum(`23849`.ablock) as toth FROM `23849` WHERE YEAR(`23849`.acoff) = %s GROUP BY m ORDER BY m ", GetSQLValueString($mhour_log_mon, "int"));
    $log_mon = mysql_query($query_log_mon, $log) or die(mysql_error());
    $row_log_mon = mysql_fetch_assoc($log_mon);
    $totalRows_log_mon = mysql_num_rows($log_mon);
    ?>
    <!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>testing ajax php mysql</title>
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="Accordion1" class="Accordion" tabindex="0">
      <div class="AccordionPanel">
        <?php do { ?>
          <div class="AccordionPanelTab"><?php echo $row_log_year['yy']; ?></div>
          <?php } while ($row_log_year = mysql_fetch_assoc($log_year)); ?>
    <div class="AccordionPanelContent">
      <table width="100%" border="0" cellspacing="5" cellpadding="5">
        <?php do { ?>
          <tr>
            <td><?php echo $row_log_mon['mon']; ?></td>
            <td><?php echo $row_log_mon['toth']; ?></td>
          </tr>
          <?php } while ($row_log_mon = mysql_fetch_assoc($log_mon)); ?>
      </table>
    </div>
      </div>
    </div>
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    //-->
    </script>
    </body>
    </html>
    <?php
    mysql_free_result($log_year);
    mysql_free_result($log_mon);
    ?>

    You only have 1 "AccordianPanel" which contains a list of "AccordianPanelTab" elements, then a list of "AccordianPanelContent" elements.
    You need to have a list of "AccordianPanel" elements, each containing a pair or "AccordianPanelTab" and "AccordianPanelContent" elements.
    HTH,
    Randy

  • PHP MySQL Error Code 500

    May be someone can help me out with this problem.
    I have setup a new site using PHP MySQL and Dreamweaver 8.02.
    Dreamweaver connects to the database but after creating a
    recordset the recordset cannot be used.
    instead Dreamweaver returns:
    HTTP Error Code 500 internal Server Error
    Any help will be much appriciated.
    Jos

    Hello,
    I have also had the same error - namely that whilst I could connect via ftp, upload/download files, and view database tables, any attempt to view of modify recordsets resulted in error 500.
    Having checked other potential causes (e.g. selection/non-selection use of passive FTP setting, enabling of php, etc.), on the back of posts here I contacted my host and asked if if could relate to mod security, as further investigation revealed that the issue only occurred on sites where mod security had not been disabled (I don't like to disable mod security for obvious reasons - and I'm told you can't do that site by site with apache2 anyway).
    After a few false starts, the problem was resolved - with the following response from my host: "The false positives were being generated by "/_mmServerScripts/MMHTTPDB.php" and that is what we've worked around in the rules. As such, any domain on [servername] using that script in the same way shouldn't generate a false-positive moving forward."
    So it seems the answer (assuming your on an apache server of course) may be to modify the rules to allow full access for MMHTTPDB.php.
    I hope that is of help to some.

  • 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 Horizontal/Vertical Repeat Region

    Hi Guys,
    I'm pretty sure this question would have been asked many times before. If so, first of all my apologies for re-posting this.
    Anyway, what I'm trying to do is create a repeat region that spans for 4 columns and then repeats the rest in rows. For example, if I have 100 records in my table (MySQL), then I want to display this in a table of 4 columns and and 25 rows (in reality, the number of records would be unspecified, of course, but still the records need to be displayed on a 4 column, X row table). For example:
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    At the moment, I have no issue with displaying the records either horizontally or vertically (explicitly) using the built in "repeat region" behavior. However, where I'm having the problem is with displaying the records in a table as the one I described above.
    I'm using DW CS5 with PhP/MySQL.
    Can I still do this using the built in "repeat region" server behavior, if so how?
    Otherwise, how else could I achieve this (ideally without using any extensions)?
    Thanks in advance for any help and support,
    Cheers

    I'm believe you should be able to modify the repeat region code to do what you want it to do.  With that said we will need 2 things:
    1.  To see the code from the page.
    2.  To know the order of the results is it:
    Horizontal: 1 2 3 4
                    5 6 7 8
    Or Vertical:
    1 5
    2 6
    3 7
    4 8

  • Php mysql math error when using format(somenumber,2)

    osx 10.5.2, php 5.2.5, mysql 5.0.51 (standard leopard desktop os install)
    Select format(myField,2) as someNumber from myTable ...
    returns data i would expect, formatted as you would expect.
    while looping through the data returned i am calculating a running total.
    for numeric values less than 1,000 results are expected. for numbers gt 1000, php seems to want to truncate the value at the comma. 1,111.11 evaluates to 1; 25,000 evaluates to 25.
    If you remove the format() from the sql statement everything works the way you would expect.
    wrapping the value returned in a floatval() had no effect.
    I am posting this on the apple site rather than php/mysql forums on the off chance that this is a mac centric issue. googling the obvious combinations wasn't productive.

    Sounds like a locale issue.
    Many international formats use comma as the decimal separator, not the thousands.
    There are many levels where this could be set. It could be an OS setting (you don't say where you or, or the locale information of your machine (System Preferences -> International -> Format). It could be in PHP (see: http://www.php.net/setlocale ), or it could be in the database (data could be written in a comma-based table).
    It will take a little research to work out where your specific problem lies.

Maybe you are looking for

  • My parents ended up with my contacts on their Iphone when updating their Iphone for the first time, help?!

    Ok, my family uses one Apple Account and we share music and stuff but when me and my sibling got Iphones like my parents, it got confusing. I was the first to sync my Iphone 4s into the computer and the Apple ID is put under my name. All of my Apps,

  • Variable substitution parameter

    Hi All, I have a scenario where in i am creating a flat file . File name is being taken from the payload using variable substitution parameter . But while wrting to a file , i need to make sure that File name doesnt get written in the file . Is there

  • Firefox prints characters instead of text.

    Trying to print from gmail, the text comes out in characters and blocks. If I use print preview and then print, it prints correctly. I have tried diabling all addons and that did not work. Prints correctly in IE. == This happened == Every time Firefo

  • Is there anyway to lock a Shared-List

    Background to this: I am deploying an Apex Reports Application. I have set up two lists. The first List is a list of all the reports that the company delivers. The second list is a list of reports that the client delivers. These lists are on separate

  • SAP BW 3.5 "Error in SQL Statement: DBIF_RSQL_INVALID_RSQL" in Infospoke

    Hi , I am working on SAP BW 3.5. while downloading the records through infospoke and giving them to the Application server side, I am getting an error  "Error in SQL Statement: DBIF_RSQL_INVALID_RSQL". Daily the Infospoke runs on delta mode. But for