Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.

  1. #1

    Default Will this work

    Hi all,

    I was wondering if it is possible to format variables from within the VALUES
    section of a mysql INSERT string.

    I have some variables that are passalong from a script and get deposited to
    a mysql db.

    since end users can submit in all uppercase or lower case, i was looking for
    some data normalization.

    so I am going to apply ucwords(strtolower($variable1));

    but in the name of keeping the script as small and sweet as possible can i
    do

    mysql_query ("INSERT INTO 10m (firstname, lastname, zipcode, email, 10mdate,
    entrydate, termsagree)
    VALUES ('ucwords(strtolower($firstname));',
    'ucwords(strtolower($variable1));', '$zipcode', '$email',
    '$month--$day-$year', '$entrydate', '$termsagree')");

    etc etc.

    or do i have to do

    $fixed_variable1=ucwords(strtolower($variable1));
    $fixed_variable2=ucwords(strtolower($variable2));

    mysql_query ("INSERT INTO 10m (firstname, lastname, zipcode, email, 10mdate,
    entrydate, termsagree)
    VALUES ('$fixed_firstname', '$fixed_lastname', '$zipcode',
    '$email', '$month--$day-$year', '$entrydate', '$termsagree')");

    i think you get the idea.

    i would prefer the former vs the latter since there are about 10 variables
    to rewrite....

    Cheers,

    Gary
    Curwe.com


    Curwe Support Guest

  2. Similar Questions and Discussions

    1. Can't get <img> to work in XML
      I'm using PHP to grab info from a database and then spit out an XML file. I'm loading the XML file into my fla and having no problems getting the...
    2. Links don't work in Shockwave movie but work in p
      Hi, everyone: I encountered a strange problem. I downloaded a sample movie from Macromedia site and noticed that the same problem occurs what I had...
    3. F12 doesn't quite work
      I press F12, and the page displays locally, but the included files (PHP) don't get included. I could've sworn it was working, once upon a time. Now,...
    4. Still trying to get a Mac to work with GPS
      I am still trying to get a Mac to work with GPS. All of the leads so far suggested have not pointed me towards a soltion, allowing the use of a Mac...
    5. Net work set up
      1)i have 2 computers both with a network card connected by cable. 2) when running main (internet)computer XP home o/s 2nd computer 98 o/s the 2...
  3. #2

    Default Re: Will this work

    Curwe Support <support-nntp@curwe.com> wrote:
    > I was wondering if it is possible to format variables from within the
    > VALUES section of a mysql INSERT string.
    >
    > mysql_query ("INSERT INTO 10m (firstname, lastname, zipcode, email,
    > 10mdate, entrydate, termsagree)
    > VALUES ('ucwords(strtolower($firstname));',
    > 'ucwords(strtolower($variable1));', '$zipcode', '$email',
    > '$month--$day-$year', '$entrydate', '$termsagree')");
    Hi Gary,

    Not quite in this form, but there is a solution. I suggest though you
    construct the statement string beforehand. Gives a much cleaner code layout
    and more control. And in case you use an editor with highlighting you'll
    see another benefit.

    $SQL = "INSERT INTO 10m (firstname, lastname, zipcode, email, " .
    "10mdate, entrydate, termsagree) VALUES (" .
    "'".ucwords(strtolower($firstname))."', " .
    "'".ucwords(strtolower($variable1))."', " .
    "'".$zipcode."', " .
    "'".$email."', " .
    "'".$month."-".$day."-".$year."', " .
    "'".$entrydate."', " .
    "'".$termsagree."')";

    mysql_query($SQL) or die (mysql_error()."<br />".$SQL);

    HTH;
    JOn
    Jon Kraft Guest

  4. #3

    Default Will This work

    [url]http://www.macromedia.com/cfusion/exchange/index.cfm?view=sn111&extID=1029986#lo[/url]
    c=en_us&view=sn111&extID=1029986&viewName=Flash%20 Extension&avm=1

    hi this is probably a stupid question but i was looking at this and wondered
    would it work in Dreamweaver MX i know it's not the most up to date dreamweaver
    and as it requires flash 8 for it to work i take it won't work on my
    dreamweaver version but just wondered please help many thanks Jimmy

    JimmyUK Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139