association table update with post boxes php/mysql table

OK, I have a dynamic site for the checkboxes are dynamically added to the page database. the name of check boxes affect one table "checkbox []". now my $_Post ['checkbox'] will be an array. now I want to take this picture and make a loop for which updates my table once for each variable in the table, but it is not working and I am perplexed...

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  for ($i=0;$i<count($_POST['SpecificationEquipped']);$i++) {
   $updateSQL = sprintf("UPDATE TestersSpecifications SET SpecificationEquipped=%s WHERE TesterModel=%s AND SpecificationID=%s",
         GetSQLValueString(isset($_POST['SpecificationEquipped'][$i]) ? "true" : "", "defined","1","0"),
         GetSQLValueString($_POST['TesterModel'], "text"),
         GetSQLValueString($_POST['SpecificationID'][$i], "int"));
 
  mysql_select_db($database_ampacin1_ampac, $ampacin1_ampac);
  $Result1 = mysql_query($updateSQL, $ampacin1_ampac) or die(mysql_error());
  }
}

I don't know how make table works how the code is to "set". Anyone who thinks that they can tell me the best way to do it?

Impression of SQL to see what is generated is the best way to solve problems with dynamically generated queries.

It is not easy to understand exactly what you're trying to do. However, it might help you to solve the problem if you understand what does the following section of code:

GetSQLValueString(isset($_POST['checkbox']) ? "true" : "", "defined","1","0")

When a form is submitted, the value of a checkbox control is submitted through array $_POST only if the box is checked. Let's say you have a box like this:


If the box is checked, the value of $_POST ["accept"] is "o". If the check box is disabled, $_POST ["accept"] is NOT defined. It is not empty, null, or something like that. There is simply not.

That Dreamweaver verifies if the variable check box exists (isset()). If so, it inserts 1 in the database field. Otherwise, it inserts 0.

The problem is that you have created a check box group, using a table. Let's say you have 10 check boxes in this group, if only 5 are selected, your table will contain only 5 Articles.

Depending on how you configure things, I think you must have differently named checkboxes for each record that must be inserted into the database. You can do it with a counter and a loop:


  

If you don't know in advance the number of items will be in your loop, you can use $i as the value for a field hidden once the loop is completed. This will allow you to browse your update queries, using the value of the hidden field to control the loop and using a meter to change the name of the boxes.

for ($i = 1; $i < $_POST['count']; $i++) {
// other stuff
GetSQLValueString(isset($_POST["cb_$i"]) ? "true" : "", "defined","1","0")
// other stuff
}

Tags: Dreamweaver

Similar Questions

  • Best way to update the images using PHP / MySQL?

    Hello
    I want to update the images using PHP/MySQL, so users can update their images and maybe a few others, but especially images.
    Thank you

    Hi, you can try this "How update an image in mysql"

  • In PHP, MySQL, MEASURE date manipulation

    I have a datetime stored in MySQL I recover from the operation of update uninstall via the following statement:

    $last_date = KT_escapeForSql ($tNG-> getColumnValue ("last_kpi_gen_date"), $tNG-> getColumnType ("last_kpi_g en_date"));

    Now, I want to add 1 day, 7 days, or a month to date.  I try to use mktime but it seems he wants it in order of date different (h, m, s, a-m-j), I tried the strtotime function and the function date to reformat the $last_date, but it doesn't seem to work.

    Is there an easy way to add days to a date variable extracted from a database of MySQL using uninstall getColumnValue?

    Hi, I'm doing this way:

    You can CHECK for MySQL with time + 8 hours:

    create view DATETIME as
    SELECT DATE_FORMAT (DATE_ADD (now (), 8 HOURS APART), '%A - %m - %j % H: % i: %s') as DT_add8hour;

    Or with + 8 days:

    create view DATETIME as
    SELECT DATE_FORMAT (DATE_ADD (now (), 8 DAYS APART), '%A - %m - %j % H: % i: %s') as DT_add8day;

    This option stores CURRENT time value allways more apart. So you can use this update another table colums duration you want. Works perfectly with DW + MEASUREMENT + PHP + MySQL

    Here are several Date and time functions

    I hope this helps you!

    Post edited by: asdaf1234

  • Insert a special character such as apostrophes with PHP/Mysql

    Hi friends,

    I have a problem with php/mysql. I created a form vach'inton a page php with dreamweaver and when I try to fill in the form with a string that contains an apostrophe ('), I got an error. It seems that integration is not possible. Would you have any idea for that. I give you the code of dreamweaver php and thank you for your help.

    <? php require_once('Connections/Mainconnect.php');? >

    <? php require_once('Zend/Date.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via 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":

    If ($theValue =="")

    {

    $theValue = "NULL";

    }

    on the other

    {

    $zendDate = new Zend_Date($theValue,"dd/MM/yyyy");

    $theValue = "" "." $zendDate-> toString("yyyy-MM-dd"). »" « ;"

    }

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "form1")) {}

    $updateSQL = sprintf ("UPDATE pers_soc_reg SET Field1 = %s, Field2 = %s,

    GetSQLValueString ($_POST ["field1"], "text").

    GetSQLValueString ($_POST ["Field2"], "double"));

    Hello friends,

    I solved the problem.

    The problem is a free extension for dreamweaver called 'check new items' of Felixone. After his retirement, all forms of work without problem.

    Thanks to you all.

  • help with php mysql connect script

    OK guys im new to php mysql and I try inserting form information in my database. IM using a sitepoint script in which I went through the tutorial made some experiences of myself and it worked...

    but now I get this error that I can't understand...

    Command error: you have an error in your syntax SQL; consult the manual corresponding to your version of the server MySQL for the right syntax to use near 'order product SET = ' 1', 'average' = size, color is ", amount = '1' at line 1

    Here is the page
    http://vaughntucker.com/imagecon/hats.php

    and this is the script
    <? PHP
    default page view
    connect to the database
    $dbcnx = @mysql_connect ('p3nl41mysql7.secureserver .net', 'imagecon', ' Dub * boss_1');
    If (! $dbcnx) {}
    echo "< p > unable to connect to the '. 'database server at this time." < /p > ";
    Exit();

    }

    Select database
    If (! @mysql_select_db ('imagecon')) {}
    exit (' < p > cannot locate the ".")
    "database at this time. < /p >");
    }

    MySQL Query add joke
    If (isset($_POST['submit'])) {}
    $product = 1;
    $size = $_POST ["size"];
    $color = $_POST ['color'];
    $quan = $_POST ['quantity'];
    $sql = "INSERT INTO command TOGETHER
    product = "$product."
    size = "$size."
    Color = "$color"
    quantity = "$quan"
    Date = CURDATE () ';
    } else {}
    ECHO 'no data sent ";

    }
    If (@mysql_query ($sql)) {}
    echo "< p > your order has been sent. < /p > ";
    } else {}
    echo ' error < p > order process: '.
    mysql_error(). / '< p > ';
    }



    ? >

    Thanks in advance

    Murray * ACE * has written:
    > $sql = "INSERT INTO command TOGETHER."
    "> product ='". $product. "',
    "> size ='". $size. "',
    "> color ='". $color. "',
    ' > quantity = ' ". $quan. "',

    No, this is not what is causing the problem. It is the use of 'order' as
    the name of the table. The order is an SQL reserved word. Either the name of the table
    should be changed, or the query INSERT rewritten as follows:

    $size = mysql_real_escape_string($_POST['size']);
    $color = mysql_real_escape_string($_POST['color']);
    $quan = mysql_real_escape_string($_POST['quantity']);
    $sql = 'INSERT INTO 'order' SET
    product = 1,.
    size = "$size."
    Color = "$color"
    quantity = $quan,
    'date' = CURDATE () ';

    Note that I surrounded order and date with backticks. I also have
    $product, was deleted because it has a fixed value. I removed the quotes from
    around $quan, because the numbers should not be quoted in SQL queries.

    The changes I did assume that magic quotes are disabled the
    Server. If they are on, you must also pass the variables $_POST
    stripslashes() like this:

    $size = mysql_real_escape_string (stripslashes($_POST['size']));
    $color = mysql_real_escape_string (stripslashes($_POST['color']));
    $quan = mysql_real_escape_string (stripslashes($_POST['quantity']);

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions.
    http://foundationphp.com/

  • Check out when a last accessed table (select, insert, update) with time stamp. Auditing enabled

    Hello world

    IM pretty new to audit the database. Auditing is enabled in the database. I would like to retrieve the news all of the objects belonged to a certain pattern when it was last accessed (select, insert, update) with time stamp. Is there any script for this? Your time and your reply is greatly appreciated. Thank you.

    Database version: 11.2.0.4

    Enable audit is not quite enough to get the details when the table is updated/inserted/selected.

    You must activate audting on the object level, then you may only be able to see your report of your choice.

    SELECT OBJ_NAME, ACTION_NAME, to_char (timestamp, ' dd/mm/yyyy, hh') of sys.dba_audit_object.

  • Why is-2 slashes after domain name now, when you publish a live site after the new update with Muse? Post also after the site he has these 2 slashes before 'index.html '.

    There are 2 slashes after domain name now, when you need to publish a live site after the new update with Muse?

    -It was always a slash after the domain name. And if BC publication the

    site - it has also these 2 slashes before "index.html" - is this correct? - or something wrong?

    slash.png

    Hi erinb61521593,

    I did some tests at my end and can confirm that it is a known problem with the latest version of Muse but I advise you to choose the option with the / / at the time of release as it will download your site in good folder on the servers of BC (that points to your domain name) and after publishing the site if you go to the url with single / it works perfectly.

    We already noted this problem with the developers of muse and I don't know that it will be fixed in the next version of Muse.

    Feel free to reply to this post, just in case I missed something or if you have any other doubts about this.

    Kind regards

    Vivek

  • Price with PHP/MySQL

    I want to use numbers from a database, prices. In the database (PHP/MySQL), the structure is ' decimal (9.2). If I put it out with PHP a number as is €9.02 9,02 but 9.20 looks like this €9,2. How can I set prices with PHP/MySQL?

    I hope that my question is simple... Thankx for any other help.

    Use number_format() functionof PHP.

  • How to create the report with check box (Update, Delete) operations

    Hi all

    I want to create report with check boxes.

    I created it based on the user's manual. But do not delete records. Please help me

    Apex. Oracle.com

    workspace: APPSGURU

    RAMBEAU. [email protected]

    P.W:rag$ 123

    Application:36232

    Page: 14

    Thank you and best regards,

    Rambeau

    Raghu,

    Request for check line deleted successfully.

    made some changes in the removal process.

    Leave.

  • I need some tutorials Ajax, PHP, Mysqli?

    Hello world

    I need tutorials on the following

    (1) I have a div that is connected to a database, it displays information x I want to do a picture-button that refreshes this div in a click.

    (2) I have 3 different pictures (thumbnails) on a page that each represents its own category of pictures, I want each image to do ' when one of the 3 images is presset, there should be a fade by displaying images (10, etc.) associated with this category (perhaps of an include statement?). under the 3 photos, if you press one of the 3 images current images in the 3 images has to falter and new photos (22 photos etc.) melted, does make sense? .

    If anyone has some good tutorials that is not impossible to understand due to the mic/accent, I'd be more than happy!

    OMFG... I just think that I found the magic for the first jewel, if someone need to solve one that I found this

    http://StackOverflow.com/questions/17438243/AJAX-update-div-tag-on-button-click

    N ° 1)

    "I just removed the"setTimeout('Ajax()',2000);" both places.

    Step 2)
    Made the small script php/mysqli one inclusion

    Step 3)

    Changed to this-->> >xmlHttp.open("GET","refresh.php",true);
    xmlHttp.send(null);<<<-- to this -->>

    xmlHttp.open("GET","Includes/frontpage/featured.php",true);

    xmlHttp.send (null);<>

    Step 4)

    Added this onclick = "Ajax (); "to my tag

  • Unable to connect error 404 PHP/MySQL

    Wow, the learning curve is killing me. Yet another challenge. I use Dreamweaver CC and this tutorial http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html

    I'm at this stage:

    1. Open comments.php . You must have a PHP page open in the Document window to create a MySQL connection.
    2. In the databases Panel (choose window > databases), click on the sign located on the Panel and select MySQL Connection.The MySQL connection dialog box appears.
    3. Type connTest as login name.
    4. For the MySQL server, type localhost. If you use MAMP ports by default on a Mac, use localhost:8889.
    5. For the user name, type phptestuser.
    6. Type the password that you chose for the phptestuser account in the password field.
    7. To the database, type php_test. Note: You need not precede the underscore with a backslash character here. It was inserted by phpMyAdmin in the previous section (see Figure 20) only because phpMyAdmin uses a query which allows wildcards.
    8. Click on Test.Dreamweaver tries to connect to the database. If the connection fails, follow these steps:
      • Check the server name, user name, and password.
      • Check the settings in the file that Dreamweaver uses to process dynamic pages (see specification of a Dreamweaver testing server).
      • Ensure that the web and MySQL server are both running.
      • Temporarily disable any firewall or security program. If the connection works, you must configure the security program to allow communication between Dreamweaver and MySQL.
    9. Click OK. The new connection appears in the data Panel.
    10. Expand connTest connection, and then expand the Tables branch. You will see the comments table in the database, you can expand to reveal the details of the columns in the table (see Figure 23).

    I can say that I followed this tutorial to the letter.

    As far as I know, XAMPP/php mySQL all running very well, the files are in the right place and everything should work. However when I type test, I get a 404 error. (Same error when I hit the select button).

    The problems on the 404 message are:

    1. There is no server running on the server test.

    Sure the testing server is running. Is there a way to test this, another that note that xampp is certainly running right now and I can connect to phpMYadmin without problem?

    2 test specified for this site server is not mapped with the http://localhost/php_test/_MMServerScripts/MMHTTPDB.php URL check that the URL prefix maps to the root of the site.

    UH... I'm sure that I put things where I was told to put them in the tutorial, but I'm lost right now where I should check that. A clue here? The files are where they are supposed to be, but maybe I entered something wrong? Except... I don't know what it might be or where to find it. Whatever IT is.

    Everything in the local files is fine.

    Thanks for your help!

    PS: Extra points to anyone who figures how to make copy/pasteable error messages! These guys are the bane of my life!

    Stop and restart the services he. Stop Xampp if still the same behavior. It should look like as below

  • Flash-PHP-MySQL data exchange

    Hello

    I've been struggling with this for a few weeks, but I still can't get it right, and all the info that I found is too ambiguous or uses AS2. What I want to do is to retrieve information from a MySQL database, using PHP and send it to Flash; and in the other direction, the input of information in the database of a Flash form. I want to do a test run Flash for my Web site.

    Could you please someone show me a simple code example (on PHP and Flash) of how to Exchange data? Thanks for your help.

    PD: I know how to work with databases in PHP, so the only PHP code, I need to see is the part of php-flash communication. Thank you.

    If you post the code you tried it is not the job for you, a person may be able to help along.

    In addition, your best bet will be to Google search (or these forums) by using terms such as 'Tutorial AS3 URLVariables'.  And if the data is retrieved mySQL tables involves a large number of lines, you should look into having PHP echo Flash data in XML format.  You should look for 'Tutorial AS3 XML PHP' for info on that.

  • PHP/MySql error message

    I posted this before and didn't get the answer I need, probably because I didn't post all my codes. I use PHP/MySql.  I created a Web site that has several forms.  When I conducted three of the forms, I get the below error messages:

    You have an error in your SQL syntax; consult the manual for your version of the MySQL server for the right syntax to use near ' condition, length, color, city, 'State', Email, Photo) VALUES ('29 ', ' 4',' used "in line 1.)

    I write the codes below.  I hope this time that I posted everything I should have so that I can get help.

    FORM

    < form action = "<?" PHP echo $editFormAction;? ">" method = "POST" enctype = "multipart/form-data" name = "individual" class = 'individual' id 'individual' = >
    < table width = "594" border = "0" class = "test" >
    < tr > < /tr >
    < b >
    < td width = "166" class = 'td' > view < table > title
    < td colspan = "3" > < span id = "sprytextfield1" >
    < label >
    < input name = "Display title" type = "text" class = "test" id = "Display title" size = "35" / >
    < / label >
    < span class = "textfieldRequiredMsg" > required </span > < / span > < table >
    < /tr >
    < b >
    < td = 'td' class > price < table >
    < td colspan = "3" > < span id = "sprytextfield2" >
    < label >
    < input name = "price" type = "text" class = 'test' id = 'price' size = '35' / >
    < / label >
    < span class = "textfieldInvalidFormatMsg" > Invalid format. </span > < / span > < table >
    < /tr >
    < b >
    < class td = 'td' > < table > format
    < td colspan = "3" > < label >
    < select name = "size" = "1" multiple = "multiple" class = 'test' id = 'size' >
    < option > 0 < / option >
    < option > 2 < / option >
    < option > 4 < / option >
    < option > 6 < / option >
    < option > 8 < / option >
    < option > 10 < / option >
    < option > 12 < / option >
    < option > 14 < / option >
    < option > 16 < / option >
    < option > 18 < / option >
    < option > 20 < / option >
    < option > 22 < / option >
    < option > 24 < / option >
    < option > 26 < / option >
    < / select >
    < / label > < table >
    < /tr >
    < b >
    < class td 'td' = > status < table >
    < td colspan = "3" > < label >
    < select name = "Condition" class = 'test' id = 'State' >
    < option > new < / option >
    < option > used < / option >
    < / select >
    < / label > < table >
    < /tr >
    < b >
    < class td 'td' = > length < table >
    < td colspan = "3" > < label >
    < select name = "Length" class = 'test' id = 'Length' >
    Long < option > < / option >
    Short < option > < / option >
    < option > mid-length < / option >
    < / select >
    < / label > < table >
    < /tr >
    < b >
    < class td 'td' = > color < table >
    < td colspan = "3" class = 'td' > < span id = "sprytextfield5" >
    < label >
    < input name = "Color" type = "text" class = "test" id = "Color" size = "35" / >
    < / label >
    < span class = "textfieldRequiredMsg" > required </span > < / span > < table >
    < /tr >
    < b >
    < class td 'td' = > city < table >
    < class td = 'td' > < span id = "sprytextfield4" >
    < label >
    < input name = "City" type = "text" class = 'test' id = 'City' size = "35" / >
    < / label >
    < span class = "textfieldRequiredMsg" > required </span > < / span > < table >
    < class td = 'td' > < table >
    < class td = 'td' > < table >
    < /tr >
    < b >
    < class td 'td' = > status < table >
    < td colspan = "3" > < label >
    < select name = "State" class = 'test' id = 'State' >
    < option > AL < / option >
    < option > AK < / option >
    < option > AZ < / option >
    < option > AR < / option >
    < option > CA < / option >
    < option > CO < / option >
    < option > CT < / option >
    < option > OF < / option >
    < option > DC < / option >
    < option > FL < / option >
    < option > GA < / option >
    < option > HI < / option >
    ID < option > < / option >
    < option > HE < / option >
    IN < option > < / option >
    < option > HERE < / option >
    < option > KS < / option >
    < option > KY < / option >
    < option > THE < / option >
    < option > ME < / option >
    < option > MD < / option >
    < option > MY < / option >
    < option > e < / option >
    < option > MN < / option >
    < option > MS < / option >
    < option > MO < / option >
    < option > MT < / option >
    < option > NOT < / option >
    < option > NV < / option >
    < option > NH < / option >
    < option > NJ < / option >
    < option > NM < / option >
    < option > NY < / option >
    < option > NC < / option >
    < option > ND < / option >
    < option > OH < / option >
    < option > OK < / option >
    < option > OR < / option >
    < option > PA < / option >
    < option > LAUGHED < / option >
    < option > SC < / option >
    < option > SD < / option >
    < option > TN < / option >
    < option > TX < / option >
    < option > c < / option >
    < option > VT < / option >
    < OPTION > < / option >
    < option > WA < / option >
    < option > WV < / option >
    < option > WI < / option >
    < option > WY < / option >
    < / select >
    < / label > < table >
    < /tr >
    < b >
    < class td 'td' = > Email < table >
    < td colspan = "3" > < span id = "sprytextfield3" >
    < label >
    < input name = "Email" type = "text" class = "test" id = "Email" size = "35" / >
    < / label >
    < span class = "textfieldRequiredMsg" > required </span > < span class = "textfieldInvalidFormatMsg" > Invalid format. </span > < / span > < table >
    < /tr >
    < b >
    < height = "26" td class = 'td' > confirm Email < table >
    < td colspan = "3" > < span id = "spryconfirm1" >
    < label >
    < input name = "Confirm Email2" type = "text" class = 'test' id = 'confirm Email2"size ="35"/ >
    < / label >
    < span class = "confirmRequiredMsg" > required </span > < span class = "confirmInvalidMsg" > the values don't match. </span > < / span > < table >
    < /tr >
    < b >
    < height td = '26' class = 'td' > photo (s) < table >
    < td colspan = "3" > < label >
    < input name = "Photo" type = 'file' class = 'test' id = 'Photo' size = "35" / >
    < / label > < table >
    < /tr >
    < b >
    < height = '131' td class = 'td' > < table > Details
    < td colspan = "3" > < label >
    < textarea = cols "Additional Details" name = "40" lines "6" = class = 'test' id = "Détails" > < / textarea >
    < / label > < table >
    < /tr >
    < /table >
    < p >
    < label >
    < input name = "Submit" type = 'submit' class = 'test' id = "Submit" value = "Post" / >
    < / label >
    < /p >
    < input type = "hidden" name = "MM_insert" value = "individual" / >
    < / make >

    SERVER BEHAVIOR


    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via 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 "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }

    $editFormAction = $_SERVER ['PHP_SELF'];
    If (isset {}
    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);
    }

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "individual")) {}
    $insertSQL = sprintf ("INSERT INTO donations (postingTitle, 'size', condition, length, color, city, 'State', email, photo) VALUES (%s, %s %s, %s, %s, %s, %s, %s, %s)", ")
    GetSQLValueString ($_POST ["'validation title"], "text").
    GetSQLValueString ($_POST ['size'], "text").
    GetSQLValueString ($_POST ["State"], "text").
    GetSQLValueString ($_POST ['Length'], "text").
    GetSQLValueString ($_POST ['Color'], "text").
    GetSQLValueString ($_POST ['city'], "text").
    GetSQLValueString ($_POST ["State"], "text").
    GetSQLValueString ($_POST ['Email'], "text").
    GetSQLValueString ($_POST ['Photo'], "text"));

    @mysql_select_db ($database_bridesmaidsrack_db, $bridesmaidsrack_db);
    $Result1 = mysql_query ($insertSQL, $bridesmaidsrack_db) or die (mysql_error ());

    $insertGoTo = "donations.php";
    If (isset {}
    $insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;
    $insertGoTo. = $_SERVER ['QUERY_STRING'];
    }
    header (sprintf ("location: %s", $insertGoTo));
    }

    CONNECTION TO THE BASE


    # FileName = "Connection_php_mysql.htm"
    # Type = 'MYSQL '.
    # HTTP = 'true '.
    $hostname_bridesmaidsrack_db = "localhost";
    $database_bridesmaidsrack_db = "bridesmaidsrack";
    $username_bridesmaidsrack_db = "";
    $password_bridesmaidsrack_db = "";
    $bridesmaidsrack_db = mysql_pconnect ($hostname_bridesmaidsrack_db, $username_bridesmaidsrack_db, $password_bridesmaidsrack_db) or trigger_error (mysql_error (), E_USER_ERROR);

    OK, so your initial problem was the condition of the word, because it is a reserved word for MySQL.

    Here is a list of the reserved words.

    http://dev.MySQL.com/doc/refman/5.1/en/reserved-words.html

    If you use a reserved word, you must place the accents around it like this...

    "condition."

    then MySQL knows you use it as a standard Word and he interprets not as command.

    OK now on the following problem.

    'Photo' column cannot be null

    When you have created your table in MySQL tells you that the photo field can not be empty. If you are forcing people to add a photo, then you need to do the checked field before the script runs / inserts. If you're ok with them NOT to add a photo, then you have to allow NULL values for this field in your table. This is a function that you would normally control via PHP MyAdmin or other MySQL database management software.

    Now, the last question:

    The Dynamic (form.action...) attribute is just how the FIELD itself will appear in SB (Server Behaivors) who is not the insertion of a plug.

    Record insertion as I said probably disappeared because some how you two when you shouldn't have one. So when we removed a DW (Dreamweaver) now think his party but is not. This can sometimes be corrected by opening the page again and closing or manually set or remove all SB side code, and then add the insertion of a plug anywhere. But at least you know what was the original problem so you can fix it after add it again.

  • How can I get the data in the foreign key?  PHP/mysql

    I managed to create registration, log-in and results pages appear for accounts of client with PHP/Mysql/Dreamweaver 8. I have another page for more information to be contained in a child table, I used the Insert Wizard to create. I can't make it work. I get either a foreign key cannot be null error or a foreign key constraint.

    If I include the foreign key in the form on the page, I can manually enter the appropriate identification number, and it works. How to automatically enter the id into the foreign key column?

    I got the authentication of users using e-mail, password and user type.

    Thanks for your help

    When someone connects, Dreamweaver creates a session variable called $_SESSION ['MM_Username"]. Use this session variable to create a recordset object to get the ID of the user, who can then be entered in the child table's foreign key field.

    Dreamweaver automatically updates the code for recordsets immediately above the DOCTYPE declaration, then you will need to move above the code for the server behavior insert record. So it must be in the following order:

    1. Recordset to get the user ID
    2. Insert the record to the child table
  • update with case

    How do update with different conditions

    Student UPDATE

    SET status = 'yes '.

    UNIV_NUMB = ' 222 -"

    where id = '112233456'

    AND YEAR = ' 2014 "

    case

    When APPLICATION_RESULT = 'C '.

    Then)

    "CONFIRMED = 'Y').

    When APPLICATION_RESULT = 'F'

    Then)

    "CONFIRMED = 'N')".

    end

    Hello

    Maybe you want something like this:

    Student UPDATE

    SET status = 'yes '.

    ID WHERE = '112233456'

    AND year = '2014' - is this really a string?  Why?

    AND ((application_result = 'C'

    AND confirmed = 'R '.

    )

    OR (NVL (application_result, 'X') <> 'C')

    AND confirmed IS NULL

    )

    )

    ;

    I hope that answers your question.

    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.

    If you ask on a DML statement, such as UPDATE, the sample data will be the content of the or the tables before the DML, and the results will be the State of the or the tables changed when it's all over.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

Maybe you are looking for