MySQL & PHP

Hi,
I have created search and results pages in CS3 and have
performed a preliminary and basic search to display all records in
the table, filtered by category with success (code attached). I
would now like to allow users to search my database based on both
the category and by entering a keyword in a form field.
Can someone help with how to do code this in MySQL? If I
click on the advanced tab, in CS3, I have the option to modify the
query, and add variables, but not sure where to start. Hoping
someone else has also allowed users to search a db, on two
parameters, one involving a keyword.
Thanks,

Thanks, but am now getting an error on my page when I type in
a keyword and select an item from the drop down list: "You have an
error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 'LIMIT 0, 10'
at line 1"
my page is www.myafricandiaspora.com/bdirectory.php
Here is the query:
SELECT bname, category, street, city, `state`, zip, country,
phone, webpage, Email, details, contact, picture
FROM directory
WHERE category = colname and details LIKE "%$keyword%"
ORDER BY bname ASC
Oddly, when I'm in dreamweaver, select the recordset from the
server behaviors panel and just do the simple sql version (without
the and clause), and click on test, it asks me for the search
parameter and displays the record properly, but when I do the same
from the advanced tab, it's not working now, with or without the
and clause.
I've added code from both my search and results pages
Help...please...

Similar Messages

  • Apache/MySQL/PHP and Mountain Lion

    I was about to buy Mountain Lion, but I just read by a reviewer that there is an issue with the webserver or websharing capabilities of it. The reviewer was saying he/she had to go into the terminal and launch it from there!
    Is anybody else having issues with developing database driven sites on Mountain Lion, or are you getting on OK with it?
    I currently use xammp as my apache/mysql/php server. Is anybody on Mountain Lion using xammp, if not, what equivalent are you using?
    Thanks.
    Mat

    Starting Apache is very easy. Simply type the following into a terminal:
    sudo apachectl start
    I think that they removed the tick box because it's so easy to do from terminal, and not something that most OSX users need.
    As SnakEyez02 mentioned, using a package like MAMP or XAMPP doesn't require this. Those apps run their own Apache

  • Update MySQL & PHP Version

    I have a Mac Mini that I am using as a server and I can't figure out how to go about updating the MySQL & PHP that is controlled by the ServerAdmin app. Any ideas?

    I ran an install of 10.4.4. The update ran with no problems.

  • Inserting & uploading records with Dreamweaver CS3, MYSQL & PHP

    I'm able to build a web page that allows for images to be
    uploaded to a server folder. Also have a web page created to insert
    info about the image into a MYSQL/PHP database.
    My goal is to find a way to combine the two together so that
    when you click the submit button... 1) the image gets uploaded to
    the server folder, 2) the info about the image gets placed into the
    database table, and 3) there is an entry in the database that
    establishes the path to the image.
    Any help or direction to a tutorial would be greatly
    appreciated.

    I use a DW extension from DMXzone (Pure PHP Upload) that
    allows me to both insert data form an online form into a MySQL
    table as well as upload files to a directory on the server with one
    button click. This might be a solution for you.

  • Bootstrap + mysql + php: robust solution for an educational dashboard?

    Hi. We are just beginning work on a dashboard for educational purposes. We need to show data tables of sts progress, notes etc...
    Kind of like the following tables:
    http://www.dreambox.com/district-reports
    We have downloaded a template based on bootstrap. It is all pretty easy except for the data integration. Before we were using flash datagrids and were also looking at flex components which were very easy to use. The questions are:
    1. Can we get the same "power" for our data tables/data grids with bootstrap "ready made" plugin ins.
    2. To replicate the datadrid in flash what do we use in bootstrap - ajax datatable or a j query plug in.
    3. How do we connect up the mysql + php + datagrid. Would it be very similar to an AS3 + php + mysql solution?
    Basically, is bootstrap html5 + CSS a viable robust solution to producing an educational dashboard.
    I use the term plugin because I don't think you call them components or widgets.
    You must also know that this will be on an enterprise level and there should be around 10,000 active users - not at the same time obviously. We will be hiring a freelancer or part tim staff to implement and maintain but we do need to know which way to go first.
    Pretty broad questions maybe, just trying to find my way and study up on what I am supposed to be studying up on. I am on Lynda.com which is OK but I need some guys creating these things to give me advice and point us in the right direction.
    Cheers in advance.

    Hi - thank you Nancy - I should get really specific now.
    I spent quite a few hours investigating and here's the run down.
    1. php + mysqli: Pretty easy as it is the same workflow as I use in flash - I was just a bit thrown by the html part and still have a few questions.
    I will post the link to the very clean and easy to follow mysql + php implementation on html tables just in case any newbies are following the post.
    http://www.sourcecodetuts.com/php/18/how-create-secure-registration-page-phpmysql-part-ii
        mysqli - they seem to use the "improved" mysqli now and this code seems to be very professional with encryption etc...
    My question is which is the best method for handling the recordset back from the database.
    1. In flash we used to use XML serialized which is easy for flash objects to pick up and then display in the datagrid tables.
    2. The example in the next link echos it out in the html table format which sounds very obvious but not sure if it is correct as I have never dome that before.
    http://www.sourcecodetuts.com/php/40/creating-and-populating-table-mysql-data-using-twitte r-bootstrap-framework
    while ($row = mysql_fetch_array($result)) {
        // Print out the contents of the entry
        echo '<tr>';
        echo '<td>' . $row['firstname'] . '</td>';
        echo '<td>' . $row['lastname'] . '</td>';
        echo '<td>' . $row['email'] . '</td>';
        echo '<td>' . $row['phone'] . '</td>';
    3. However I am more used to dealing with an object returned and then dealt with in flash BUT a simple html table couldn't deal with that so - I have just started reading re: ajax or javascript. Are they the best way to handle data returned from a database. As I say this dashboard wil have to be used my many thousands and we will be creating various tables with multiple parameters inputted via dropdown box lists.
    My workflow in flash - would it be javascript that would replicate that functionality or do I just echo out in tr and td tags as in above - seems to basic.
    Sorry about repeating mysel above and going on and on but I hace finally got there - just missing the last part in the puzzle.
    Cheers

  • CANNOT FIND mmhttpdb.php  and mysql.php  files

    does anyone know where I can download these two files from ? (in order to connect to database)
    mmhttpdb.php     mysql.php
    I deleted them accidentially.

    * Vista/Windows 7: C:\Program Files (x86)\Adobe\Adobe Dreamweaver CC\Configuration\DisabledFeatures
    * Mac OS X: /Applications/Adobe Dreamweaver CC/Configuration/DisabledFeatures
    If they no longer reside anywhere including your trash/recycle bin, you may need to re-install CC.
    Nancy O.

  • Communication problem MYSQL PHP XML Flash.

    I have driven myself into a corner with this so I hope someone here knows a solution.
    I am building a photogallery with a simple html layout but with a flash slideshow.
    The data for each album and photo are stored in a mysql database. Each photo-image is in one big folder on the server. With PHP I sort out which photo belongs to what album and display them accordingly. To start the slideshow people can click on a link near the album, this link will send a < href> with the album ID to an PHP file (xml.php) that will generated an XML output created from the MYSQL server. Here comes my problem:
    Loading XML into flash is no problem BUT I only know how to do this with a static or self supporting XML output. (xml.php needs the input of the album ID else it will not get the correct data). For now I have a temporary solution where I write the XML output from xml.php to a txt file and let Flash read from there, but is there a way where I can read directly from xml.php?

    Echo your formatted xml out as a string in xml.php, Flash will then read your dynamically generated XML.

  • [CLOSED] Weird mysql/php issue.

    Hi,
    I am running an ArchLinux as my Server. It's a fresh install. I just configured nginx as my Webserver and then configured MySQL. I wanted to use phpMyAdmin as a manager. I installed it via wget and it worked fine. But all of a sudden it would not let me log in anymore. The log in screen just keeps on popping up, without any errors or anything. It tried reinstalling phpMyAdmin, I also tried the alternative chive. In chive I get the error "CDbConnection failed to open the DB connection." I really am at a loss here, has anyone else encountered a similar issue and can point me in the right direction?
    Disclaimer: Please excuse my possibly poor english, as it is not my native language, also please excuse any questions that may sound noob-like, because I am quite new to Arch.
    Last edited by oengelha (2012-12-15 17:40:09)

    config.inc.php should be in
    /etc/webapps/phpmyadmin
    but the installation symlinks that file to
    /usr/share/webapps/phpMyAdmin
    where the installation is.
    You'll have to add this directive in open_basedir @
    /etc/php/:/usr/share/webapps/
    Also might need an alias in
    /etc/nginx/nginx.conf
    What I do is symlink
    ln -s /usr/share/webapps /srv/http/.webapps
    /srv/http being my www directory I can visit mysite.com/.webapps/phpMyAdmin to access.
    This can be a security issue, maybe allow only local access or use another mean of accessing the installation.
    Also symlinking just the installation directory to a hidden directory precursed with '.' won't float, like mysite.com/.phpmyadmin
    Last edited by ackt1c (2012-12-16 17:44:01)

  • Is it possible to load an swf from MySQL /PHP

    Hi,
    I hope someone can help me.
    I like to call for different SWF files from a link in a MySQL
    database to use in a Detailpage with PHP.
    Photos and text are no problem.
    The AC code is probably complicating things.
    Is it possible? And if so how?
    Maybe someone can help me out.
    Any help will be much appreciated.
    Thanks, Jos

    ye that.s possibe .You just need to have a dummy swf which
    check checks for
    link and therfore the swf they intend to call and load them .
    "arnhemcs" <[email protected]> wrote in
    message
    news:fdrm64$crb$[email protected]..
    > Hi,
    > I hope someone can help me.
    >
    > I like to call for different SWF files from a link in a
    MySQL database to
    > use
    > in a Detailpage with PHP.
    > Photos and text are no problem.
    > The AC code is probably complicating things.
    >
    > Is it possible? And if so how?
    >
    > Maybe someone can help me out.
    > Any help will be much appreciated.
    >
    > Thanks, Jos
    >

  • Will Apple update Apache / MySQL / PHP on Tiger 10.4.11

    Recently, a scan was made on the two xServes that I have, both running 10.4.11 with only the web services set up. They are running the default bare bones setup for Tiger Server 10.4.11.
    The scan showed issues with the current install of Apache and PHP. I have been told I need to update the serves to a more secure version of Apache, Mysql, and PHP.
    Does anyone know if Apple is going to issue an update for this? Is my only option to patch together a more recent version of Apache, Mysql, and PHP to patch this?
    Or is Apple's answer to my dilemma is to just upgrade to Leopard?
    Thanks for your comments.

    Your choices here fairly limited; there's the upgrade Leopard, loading (for instance) the [MAMP|http://mamp.info] kit or other such kit and shut down the integrated stuff within Mac OS X Server, or rolling your own Apache and related pieces. If these are Intel Xserve boxes, then you could tactfully and officially drag your heels for a couple of months and upgrade to Snow Leopard.

  • Mediawiki, mysql, php? problems [SOLVED]

    On Sunday my Arch install that is hosted by Slicehost became unresponsive to them so they had to do an emergency reboot. After it came back up my install of mediawiki was (and still is) only returning a blank page (at least in Firefox). After some digging I found out that part of the problem was that mysqld wasn't starting so I managed to get that fixed by commenting out the lines relating to innodb and putting in skip-innodb into my.cnf. But I'm still getting a blank page.
    According to Mediawiki's manual, "A blank white page indicates a PHP error which isn't being printed to the screen." They give two lines to put into LocalSettings.php to force error messages but after doing that I'm still getting a blank page. Changing display_errors in php.ini to ON didn't have any effect.  When I load the wiki in Safari I get the following error: "Got java.io.EOFException (Server closed connection while sending the HTTP header.): http://some_url.com/mediawiki/index.php/Main_Page". I have no idea what this error means and googling java.io.EOFException doesn't bring up anything very helpful. My PHP Test Page indicates that PHP is up and running.
    Any ideas on fixes or where I can find more clues?
    [EDIT]
    Mysql was definitely the root of the problems with Mediawiki. I tried nearly every suggestion listed in the forums for fixing a mysql install that wouldn't start but nothing worked. I even completely uninstalled mysql and reinstalled it but it still refused to start. I switched over to postgresql and switched mediawiki to run with that. Problem solved.
    Last edited by k_odoma (2009-05-23 01:48:35)

    There are some other things that must be done to connect to
    the database
    (such as passing the usernamee, password, and host info to
    mysql_connect()
    and storing the connection resource), and those might be in
    the include
    files. I generally place all of the connection parameters in
    a separate file
    that is located in a folder that can't be accessed by a
    browser, for
    security purposes.
    Paul Swanson
    Portland, Oregon, USA
    "Amy Blankenship *AdobeCommunityExpert*"
    <[email protected]>
    wrote in message news:edk6ui$69c$[email protected]..
    > What's in the include(s)?
    >
    > "83Dons" <[email protected]> wrote in
    message
    > news:edk5s5$4uk$[email protected]..
    > > Here is the php code for the 'read' and 'write'
    parts:
    > >
    > >
    > >
    > > <?php
    > > include '......';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $sql = "select A1Answer from authorware where id =
    '13'";
    > > $result = mysql_query($sql);
    > > $answer1 = mysql_result($result,0,"A1Answer");
    > > print $answer1;
    > > ?>
    > >
    > > <?php
    > > include '............';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $newdata = $_GET['data'];
    > > mysql_query("insert into authorware (A1Answer)
    values('$newdata')")
    or
    > > die(mysql_error());
    > > mysql_close(); ?>
    > >
    >
    >

  • MYSQL, PHP Problems

    I am trying to connect Authorware to my mysql database. Both
    are online and I want to write test answers to my database
    and also read them back out and display them in my authorware
    piece.
    In a plain authorware page i have in a calculation:
    Result := ReadURL
    http://www.dundee.ac.uk/.../example/authorware2.php")
    And then {Result} on the authorware page.
    What returns is the source code for the php page plus
    whatever is printed to the screen by that .php page. I want
    what is printed to the screen as it is the contents of the
    variable needed, but not the rest of the stuff. How do I
    simple pass just that variable back to authorware and not all
    the rest of the stuff.
    I also have an issue with writing to the database using:
    action := "?data="
    query := ActivityAnswer1a
    db_loc := "
    http://www.dundee.ac.uk/..../"
    URLstring := db_loc^"authorware.php"^action^query
    queryString := ReadURL(URLstring)
    It seems to sometimes write 2 entries and not the required
    one. Not sure why.

    There are some other things that must be done to connect to
    the database
    (such as passing the usernamee, password, and host info to
    mysql_connect()
    and storing the connection resource), and those might be in
    the include
    files. I generally place all of the connection parameters in
    a separate file
    that is located in a folder that can't be accessed by a
    browser, for
    security purposes.
    Paul Swanson
    Portland, Oregon, USA
    "Amy Blankenship *AdobeCommunityExpert*"
    <[email protected]>
    wrote in message news:edk6ui$69c$[email protected]..
    > What's in the include(s)?
    >
    > "83Dons" <[email protected]> wrote in
    message
    > news:edk5s5$4uk$[email protected]..
    > > Here is the php code for the 'read' and 'write'
    parts:
    > >
    > >
    > >
    > > <?php
    > > include '......';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $sql = "select A1Answer from authorware where id =
    '13'";
    > > $result = mysql_query($sql);
    > > $answer1 = mysql_result($result,0,"A1Answer");
    > > print $answer1;
    > > ?>
    > >
    > > <?php
    > > include '............';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $newdata = $_GET['data'];
    > > mysql_query("insert into authorware (A1Answer)
    values('$newdata')")
    or
    > > die(mysql_error());
    > > mysql_close(); ?>
    > >
    >
    >

  • MySQL & PHP issues since upgrade

    Little bit of background: I ran an arch server about two years ago, basically a personal web server (for about a year).  Had apache, mysql and php running nicely on it using the basic configurations with some minor changes.
    Now, present day.  I have recently installed Arch again and once the upgrades were announced, I held off on installing the LAMP applications.  So, Friday I installed them (as oppsed to upgrading), and thought I had them all working fine.  Apache was running, mysql was running (command line access was working well with one exception, more on that later), and php was being parsed.  When I tried to pull data out of a database, i was getting "call to undeclared function mysql_pconnect()."  I googled the error and searched the Arch forums, and everything said to make sure php was compiled with the '--with-mysql' option.  I checked that using phpinfo(), and indeed it was, but it was '--with-mysql=/shared', /usr' (or something similar).  What I ended up doing was removing the arch package and recompiling php myself using '--with-mysql' (no arguments) and it works beautifully.  So, basically, is the arch configuration for php correct?
    Also, issue number two, I have created a non-root user in mysql, but when i try to log in i receive access denied for 'user@localhost' (using password: YES).  Did i miss a setting that won't allow me to log in as anyone but root?
    Thanks in advance. 

    simple, edit your php.ini like so:
    BEFORE:
    1250:;extension=mysql.so
    AFTER
    1250:extension=mysql.so
    no need to recompile php.
    ps: "grep -n mysql.so /etc/php.ini"

  • MySQL php and CHARACTER SET error

    Still very new to php and MySQL, in fact this is my first
    site using it.
    I have got an issue with displaying characters, namely the
    £ sing, all I get is an ? displayed.
    I have been told to use, utf8 in the database field but this
    has not helped cure the problem.
    I'm building the site in DW CS3 and it's all running off my
    Mac using OS X 10.5.1 and the built in php client.
    Could anyone show me the right way to go?

    Ok I think my IQ is falling me, it's been a long week.
    <?php header('Content-type: text/html;charset=utf-8');
    ?>
    Is the first line of code on the test page I have got
    running. I have no error but I also have no £ sings.
    Here is the live page:
    http://www.epos-acoustics.com/test.php
    The page code:
    <?php header('Content-type: text/html;charset=utf-8');
    ?>
    <?php require_once('Connections/epos.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "", $theNotDefinedValue = "")
    $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_epos, $epos);
    $query_rs01 = "SELECT * FROM epos_shop ORDER BY my_shop_id
    ASC";
    $rs01 = mysql_query($query_rs01, $epos) or
    die(mysql_error());
    $row_rs01 = mysql_fetch_assoc($rs01);
    $totalRows_rs01 = mysql_num_rows($rs01);
    ?>
    <!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>shop text test</title>
    </head>
    <body>
    <?php do { ?>
    <table width="600" border="0" cellspacing="2"
    cellpadding="2">
    <tr>
    <td width="92">Product name: </td>
    <td width="494" colspan="2"><?php echo
    $row_rs01['my_shop_product']; ?></td>
    </tr>
    <tr>
    <td valign="top">Description:</td>
    <td colspan="2"><?php echo
    $row_rs01['my_shop_text']; ?></td>
    </tr>
    <tr>
    <td>Price:</td>
    <td colspan="2"><?php echo
    $row_rs01['my_shop_price']; ?></td>
    </tr>
    <tr>
    <td height="30" colspan="3"> </td>
    </tr>
    </table>
    <?php } while ($row_rs01 = mysql_fetch_assoc($rs01));
    ?></body>
    </html>
    <?php
    mysql_free_result($rs01);
    ?>
    Am I missing the point or do I have something wrong with the
    table or field?

  • Flash builder 4.6 flex for mobile with mysql php and json

    I am trying to create an app that get data from online mysql server via php service and displays the data in a list
    I have been looking all over the internet but had no success in finding a working tutorial and i am frustrated
    can anyone help or direct me to a working tutorial please ?

    Watch the Online Video Course Flex 4.5 and PHP: Creating Data-Driven Applications

  • Help with MySQL/PHP Connection

    Hi,
    I'm making a site that requires the storage of information via MySQL.  I've set up my testing server, and it connects fine.  When I try to add a MySQL connection, however, I keep getting the "HTTP Error Code 404: File Not Found" error.  I've tried using both the MySQL server provided by my web host and one hosted on my own computer (using "localhost" as the server), but both give me the same error.  The error box says that perhaps:
    1) There is no testing server running on the server machine.
    2) The testing server specified for this site does not map to the http://**mywebsite**.com/_mmServerScripts/MMHTTPDB.php URL.  Verify that the URL Prefix maps to the root of the site.
    I'm certain it's not #1, because both of my MySQL servers work fine outside of Dreamweaver.  But I'm not quite sure what #2 is saying.  Any help?
    Thanks in advance.

    nickf77 wrote:
    I have my testing server set up at my FTP account that came with my hosting package.  Should it not be?
    It's not ideal, but you can do it that way. The principle is still the same.
    When using a remote connection, the value of Host directory is the same as you use for FTP connections to your remote site. In many cases, this is left blank, is simply a forward slash, or is something like public_html. In any event, it's the root level of your website.
    URL prefix is also the root level of your site, but expressed as a URL: http://www.example.com/.
    Host directory and URL prefix must both point to the same place. The first is a path, the second is a web address.

Maybe you are looking for