MySQL & PHP -- Help!

Hi guys,
Long time, no see! ;-)
Anyway, I've got a question for someone who is pretty darn
good with PHP,
forms, and MySQL. This is ultimately what I need to achieve:
I'm creating a webpage for my university that will allow the
professors in
the IST department to select their preferences in course
choices. I want to
list out each IST course and then give them two different
things to do with
each course. The first thing is they need to select if
they've taught that
IST course before. Secondly, they need to say whether they
"don't want to
teach" the course, are "willing to teach" the course, or
"really want to
teach" the course. OK, hope this makes sense so far. What I
need help with
is figuring out how to put all the choices for each categorey
into one field
in a MySQL database. For example, if they selected the "don't
want to teach"
option (I'm not sure if a drop-box or radio button would work
best...) for
IST 215, IST 110 and IST 230. How can I have those courses
entered into the
single database field called "dontwant?"
This is my code so far:
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or
die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Get values from form
$name=$_POST['name'];
$thedate=date('m-j-y');
$taughtbefore=;
$dontwant=;
$willing=;
$reallywant=;
$comments=!trim($_POST['comments']);
// Insert data into mysql
$sql="INSERT INTO $tbl_name(name, thedate, taughtbefore,
dontwant,
willing, reallywant, comments)VALUES('$name', '$thedate',
'$taughtbefore',
'$dontwant', '$willing', '$reallywant', '$comments')";
$result=mysql_query($sql);
// close connection
mysql_close();
Is there a way I can like...append all these values into one
string to pass
into the single database field...? As you can see, I really
don't know how
or what values to assign to those empty strings up there...
I'm really
unsure of how to go about doing this. I hope this makes
sense...
Thanks for any and all of your time!
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
Blog:
http://avenuedesigners.com/blog/
Web dev articles, photography, and more:
http://sourtea.com
=============================================
Proud GAWDS member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================

Hi Murray,
Allow me to clarify. I ultimately need to display something
like this...and
this would be reading from the MySQL database, and output in
a table on the
webpage:
| No Teach | Want to Teach | Really want |
| IST 250 | IST 420 | IST 330 |
| IST 110 | IST 101 | IST 311 |
| IST 332 | | IST 120 |
| | | IST 440
|
I understand your approach and think it's a good idea. I
guess I should have
a table for each, like: NoTeach, WantToTeach, and ReallyWant.
My question is
how I would put the right IST course into the right table.
Like if they
selected "I don't want to teach" would I have some type of if
statement to
sort them into the right tables? If so, can you give me some
code on how it
would work?
Thanks!
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
Blog:
http://avenuedesigners.com/blog/
Web dev articles, photography, and more:
http://sourtea.com
=============================================
Proud GAWDS member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================
"Murray *ACE*" <[email protected]> wrote
in message
news:[email protected]...
> Why would you want to put all of that into a single
field? Sounds like
> the wrong approach to me....
>
> I'd have a NoTeach table, containing at least three
fields -
>
> termDate
> profID
> classID
>
> Each professor's "noteach" selection would then be a
separate record in
> that table, which could all be collated for display....
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
> ==================
>
>
> "Shane H" <[email protected]> wrote
in message
> news:[email protected]...
>> Hi guys,
>>
>> Long time, no see! ;-)
>>
>> Anyway, I've got a question for someone who is
pretty darn good with PHP,
>> forms, and MySQL. This is ultimately what I need to
achieve:
>>
>> I'm creating a webpage for my university that will
allow the professors
>> in the IST department to select their preferences in
course choices. I
>> want to list out each IST course and then give them
two different things
>> to do with each course. The first thing is they need
to select if they've
>> taught that IST course before. Secondly, they need
to say whether they
>> "don't want to teach" the course, are "willing to
teach" the course, or
>> "really want to teach" the course. OK, hope this
makes sense so far. What
>> I need help with is figuring out how to put all the
choices for each
>> categorey into one field in a MySQL database. For
example, if they
>> selected the "don't want to teach" option (I'm not
sure if a drop-box or
>> radio button would work best...) for IST 215, IST
110 and IST 230. How
>> can I have those courses entered into the single
database field called
>> "dontwant?"
>>
>> This is my code so far:
>>
>> // Connect to server and select database.
>> mysql_connect("$host", "$username", "$password")or
die("cannot
>> connect");
>> mysql_select_db("$db_name")or die("cannot select
DB");
>>
>> // Get values from form
>> $name=$_POST['name'];
>> $thedate=date('m-j-y');
>> $taughtbefore=;
>> $dontwant=;
>> $willing=;
>> $reallywant=;
>> $comments=!trim($_POST['comments']);
>>
>> // Insert data into mysql
>> $sql="INSERT INTO $tbl_name(name, thedate,
taughtbefore, dontwant,
>> willing, reallywant, comments)VALUES('$name',
'$thedate',
>> '$taughtbefore', '$dontwant', '$willing',
'$reallywant', '$comments')";
>> $result=mysql_query($sql);
>>
>> // close connection
>> mysql_close();
>>
>>
>> Is there a way I can like...append all these values
into one string to
>> pass into the single database field...? As you can
see, I really don't
>> know how or what values to assign to those empty
strings up there... I'm
>> really unsure of how to go about doing this. I hope
this makes sense...
>>
>> Thanks for any and all of your time!
>>
>>
>> --
>> Shane H
>> [email protected]
>>
http://www.avenuedesigners.com
>>
>> =============================================
>> Blog:
>>
http://avenuedesigners.com/blog/
>>
>> Web dev articles, photography, and more:
>>
http://sourtea.com
>> =============================================
>> Proud GAWDS member
>>
http://www.gawds.org/showmember.php?memberid=1495
>>
>> Delivering accessible websites to all ...
>> =============================================
>

Similar Messages

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

  • NEED URGENT PHP HELP

    Well I need a freelancer to create a database for
    www.singersweb.com ( a website for singers…) the database
    includes creating profile system a rating system and more. It would
    help if you know how to work with flash, xml, mysql, php…
    just whatever it takes to get the job done. Also I will do all the
    design work.
    If interested or have any comments or questions reply or
    better yet email me at [email protected] thank you.
    Donnavan

    hello i would like to know if
    i could download dreamweaver on my windows 98

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

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

  • MX / PHP / MySQL results_page help

    Desperately seeking help. I am using dreamweaver, php and
    MySql. I am building my first dynamic web page (so be easy on me, I
    am green:) and I am having troubles with a results page. I got the
    simple SearchString working just fine – but I can't get an
    advanced search page to work.
    On the search page, I have several list boxes (for simplicity
    I will only refer to two of these list boxes). The list boxes are
    in a form named form2. The list boxes allow a user to select one or
    many. Rather than listing the menu structure, I have this set up
    dynamically (pulls the info from the database).
    In the returned_results page, I have a recordset with the SQL
    e.g.: (keep in mind that form2 doesn't appear in the query anywhere
    – this might be the problem?)
    SELECT blah blah
    FROM blah blah
    WHERE RESTAURANTPRICE_ID like 'value1' AND CUISINE_ID like
    'value2'
    ORDER BY REST_NAME ASC
    Variables:
    Name; default value; runtime value
    value1 % $_GET['PRICE_Price']
    value2 % $_GET['CUISINE_Name']
    Now if I test this from the search page, the returned_results
    returns ALL columns of data, regardless of what I selected from the
    list boxes. Tested it again by changing the default variable value1
    and value2 to 1 and it will return ALL columns that meet this
    criteria, but again, this is regardless of what I selected from the
    list box.
    Somehow my returned_results query works fine on its own, but
    its not making the connection from the search page where a user
    would select their criteria.
    I can upload code if needed. What the heck am I doing wrong?

    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words LIKE '%$keyword%' ORDER BY id DESC", GetSQLValueString($colname_Recordset1, "text")); 
    Why are you using the $keyword variable rather than the sprintf parameter? I don't know php, but it seems like that is your problem. Maybe try something like this:
    $query_Recordset1 = sprintf("SELECT * FROM images2 WHERE key_words LIKE %s ORDER BY id DESC", GetSQLValueString("%" . $colname_Recordset1 . "%",  "text"));

  • PHP/mySQL code help please

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

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

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

  • MySQL/PHP error Help

    when trying to login to my database i get a Code 404 error, file not found reasons:
         1.There is no testing server running on the server machine. (if i take out the testing server check box on the site server management area then i get an unknown error)
         2. The testing server specifyed for this site does not map to the http://....../public_html/_mmServerScripts/MMHTTPDB.php URL. Verrify that the URL prefix maps to the root of the site.
    Can anyone tell me what i am doing wronge?

    You cannot test PHP/MySQL commands without a testing server.  Are you sure you DON'T have one defined for this site?

  • OT: Help with MySQL/PHP line (SQL syntax)

    I have this now -
    $colname_rsPassword = $_POST['password'];
    $query_rsPassword = sprintf("SELECT contactFName,
    contactLName,
    contactPassword, contactEmail, contactRecord FROM
    tblcontactdata WHERE
    contactPassword = %s", GetSQLValueString($colname_rsPassword,
    "text"));
    How would I change that to include $_POST['LName'] and
    $_POST['FName'] (as
    posted from the form) in the WHERE clause?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================

    I did it another way -
    GetSQLValueString($colname_rsPassword, "text"),
    $_POST['fname'],
    $_POST['lname']);
    goes to this -
    GetSQLValueString($colname_rsPassword, "text"),
    "'".$_POST['fname']."'",
    "'".$_POST['lname']."'");
    Woiks!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Joe Makowiec" <[email protected]> wrote in
    message
    news:[email protected]..
    > On 11 Oct 2006 in macromedia.dreamweaver.appdev, Murray
    *ACE* wrote:
    >
    >> SELECT contactFName, contactLName, contactPassword,
    contactEmail,
    >> contactRecord FROM tblcontactdata WHERE
    contactPassword =
    >> 'uwUYreTTM' AND contactFName = Murray AND
    contactLName = Summers
    >
    > That might be the problem. Try adding the quotes to the
    string:
    >
    > $query_rsPassword = sprintf("SELECT contactFName,
    contactLName,
    > contactPassword, contactEmail, contactRecord FROM
    tblcontactdata WHERE
    > contactPassword = %s AND contactFName = '%s' AND
    contactLName = '%s'",
    > GetSQLValueString($colname_rsPassword, "text"),
    $_POST['fname'],
    > $_POST['lname']);
    >
    > --
    > Joe Makowiec
    >
    http://makowiec.net/
    > Email:
    http://makowiec.net/email.php

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

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

Maybe you are looking for

  • One to One link between VBRP items and BSEG items

    Hi All, I am working on a program where I have to link between VBRP table items against BSEG table items. But in BSEG, the invoice items are summarised based on Material Number, profit center etc.. Is there a way to divide them, like any other table

  • Mail search results are not in chronological order.

    when I search for mail the results in iOS7 aren't in chronological order anymore. Both on my iphone 5 and my iPad 2.

  • Group photos together

    Hi, I am making a movie made up of A LOT of still images, much like a stop motion animation. I am wondering if it is possible to group photos together once I have them how I want them so I can move them around like a single video clip. Or will I have

  • Sending order data to an external system using scp sftp (osm 631.221)

    Hello There, I need to come up with a means of sending some order data to an external system via SCP or SFTP. I was looking at an automated task that would fire off some Java to package the data, create the file and send it. I then have to write anot

  • Running STAR program in Date Effective mode

    Hi All, How the date effective mode of Synchronize Territory Assignment rule concurrent will work? Will it sync all the active territories in that date range? For example if I run the STAR program from 01-Mar-2010 to 31-Mar-2010, will it sync all the