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.

Tags: Dreamweaver

Similar Questions

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

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

  • Call to undefined function getsqlvaluestring() with PHP mysql Dreamweaver

    Hey guys, I'm new to the forum and it seems very useful. I think I have a unique problem well.

    Although this script worked for a year or two, all of a sudden, during the holidays, he went to hay

    Front end is always get all the information, it must be the Database.But when I try to connect through the side admin I created with php and database of dreamweaver extensions normal I get this error.

    I do not know many php - then I'll hide the chain at the moment - if I need to paste the code that I'll - thank you in advance


    Fatal error
    : Call to undefined function getsqlvaluestring() in /xxxxx/xxxx/xxxxxxx/xxxxxxx/newsletters/xxxxxxx/xxxxxxx/admin/login.php on line 22

    Vicinity of line 22 looks like this

    @mysql_select_db ($database_promocenter, $promocenter);

    $LoginRS__query = sprintf ("SELECT username, password, destination_page FROM users WHERE username = %s AND password is %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "int"));

    $LoginRS = mysql_query ($LoginRS__query, $promocenter) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    First part looks like this

    < form id = "form1" name = "form1" method = "POST" action = "<?" PHP echo $loginFormAction;? > ">"
    < b >
    < td bgcolor = "#dedede" >
    < table width = "400" border = "0" align = "center" cellpadding = '3' cellspacing = "0" bgcolor = "#ffffff" >
    < b >
    < td height = "35" align = "right" valign = "middle" id = "description" > user name: < table >
    < height td = "35" > < label >
    < input style = "height: 20px;" border: 1px solid #999999 "name ="username"type ="text"id ="username"size ="35"/ >"
    < / label > < table >
    < /tr >
    < b >
    < td height = "35" align = "right" valign = "middle" id = "description" > password: < table >
    < height td = "35" > < label >
    < input style = "height: 20px;" border: 1px solid #999999 "name ="password"type ="password"id ="password"size ="35"/ >"
    < / label > < table >
    < /tr >

    Anton

    Could also show you it could never work.  Why?  Because the call to the function is made before the function is defined.  He would always stop execution with an undefined function error.

    Now - it seems that you have added the users authentication that was placed before the code block in which the function is defined.  So I would say that you move it-

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

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

    {

    If (via PHP_VERSION< 6)="" {="" 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;

    }

    }

    from its current location to a new block just under the connection with the directive, i.e.,.

    MOVE HERE ? >

    <>

    Validate request to connect to this site.

    so that the final code looks like this-

    <>

    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;

    }

    }

    ?>

    <>

    Validate request to connect to this site.

  • Insert a special character at the beginning of each page in the body of the text running?

    Hi all

    How can I go about writing a script that can insert a character (the same character) on each page of a document (say a book) in the body of text running?

    It would be different from a head of the race or the page number. A single character at the beginning of each page!

    Thank you

    Sorry, Jarek and thanks for pointing out the error...

    for (p = 0; p

    {

    app.activeDocument.pages [f] .textFrames [0] .lines [0] .insertionPoints [0] .silence = "Book";

    }

    Vandy

  • Under Type menu - Insert a special character - markers - current Page number in the text frame on the Master Page gives the letter A and also a horizontal black line the width of the text box.   This line is not a rule.  Turn on the Wellin gives another l

    Is anyone out there?

    I found the problem.  It was a rule after all.  I didn't the insertion point to the right place.  Everything is OK now.

  • Insert a special character into the Table

    11g R2 on 64-bit Linux.

    First I created a table TEST (name varchar2 (100 char))

    Then I have create procedure sp_insert(varchar2 p_name)

    insert into TEST (p_insert) values;

    Last I have run the sp_insert procedure ("' a & b '");

    Now, here's the question. It prompted me to an entry. Obviously, the system assumes that the & b is a prompt variable. But in reality, in fact I want to insert the value ' a & b "literally.

    I learned that there are several ways to work around for example SET DEFINE OFF or SET ESCAPE in sqlplus, use 'a' | Chr (38) | 'b' and 'a' |' &' | ' b'. They are all good. But I really need is to dynamically insert the 'a & b' that happened during the first web page in the table on the fly.

    What are the General methods to do?


    Thank you

    I guess, Oracle will automatically take care of that.
    It poses problem when you run the proc of the IDE.

  • Tables do not show with PHP/MySQL, even after upgrade to version 8.0.2

    According to the technical note, this issue has been resolved with the 8.0.1 upgrade and I am currently at version 8.0.2. But I still don't see my tables. My database names have dashes in them (I can't do anything about it since it is what my webhost). I can test my connection and it works fine. I can hit select when you create a new connection and its able to analyze my data fine names. But when I try to extend the Tables under the tree, I get 'None '.

    I solved this problem. If you have similar problems, connect to your testserver, find the _mmServerScripts folder and copy the scripts ' copy of "on other scripts. In other words, fly over copy of fopen on fopen and copy of MMHTTPDB.php MMHTTPDB.php

    Here they put technical note (if they did, I didn't see it).

  • Problem with php/mysql

    I'm working on a simple form for my website. I have successfully completed registration and the connection and I put the finishing touches on a script that allows them to change their password. I received the script to give me error messages if the user name and the old passwords do not match, or if they do not find the user name in the database. I also got say the change was successful, but when I check the database, the new password was not included. My AS is the first, then my php... This is the area I have a problem...

    You were right, it was the insert statement. It should be 'UPDATED' because there is already a variable that stands for the account already exists. I only wish I'd seen your comment first of all, because you were also right about inserting the password without the username; Fortunately, I'm testing only, there is no problem when this code ended up changing the passwords of every single data entry that I did!

  • delete the special character in the data

    Please guide me when the user enters data across before as letter size, then he insert a special character also include to store.
    Then when I have generations who, in xls sheet, then this special character are act as entered the key. see examples of data like this

    example of data *. * like that

    I would like to know how to cut this special character in the documents.

    Vincent HB

    You could try to build something with the OWA_PATTERN package:

    DECLARE
      v_text VARCHAR2(255) := 'my data  like this';
    BEGIN
      v_text := REPLACE(v_text, ' ', '_');
    
      OWA_PATTERN.CHANGE(v_text
                        ,'\W'
                        ,''
                        ,'g');
    
      v_text := REPLACE(v_text, '_', ' ');
    
      DBMS_OUTPUT.put_line(v_text);
    END;
    /
    my data  like this
    

    C.

  • Invisible ESSId with a special character - Satellite M40

    Hello

    I have a Satellite M40 with a card atheros AR5005g wireless.
    I have a wireless network with WPA2-PSK encryption. The ssid looks like this: g4s8j6b-extraordinary character-o7v35s7gt3q1c6b8
    With the latest version of the driver, it is impossible to see one ssid to connect to this network.
    I tried a USB of Atlantis wireless adapter and it can find the wirelessnetwork (I can not connect because the USB adapter is not supported WPA2-PSK)

    For me it is the problem of driving. How can I solve this problem? This 'special character' is not recognizing drivers isn't? is it possible to convert the ssid in the HEX code and insert the ssid in hexadecimal and hexadecimal key in a data to force the connection? (manual connection like Linux)

    your faithfully

    Oh this forum does not support the character... it looks like this: http://en.wikipedia.org/wiki/%C3%9F
    (Unicode U + 00DF)

    That the SSID is very long. Have you tried to use a shorter SSID?

  • Display records with a special character to the end user

    Hello

    What follows with the exception of special characters such as the comma, colon (:), space, preview, brackets [], parenthesis(), key entry, quote (') single, the double quotes (""), full stop (.), slash (/) forward, backward slash (\), + (plus), % (percentage),?) (questionmark), # (pound sign)

    -> if anyone is available in the record, I want it back and also show the special character. for example, retrieval must be id 21, 22: 16
    -> also I want a list of special characters like message in the sql
    for example, 16 ID, (¶, §) must be displayed in the output



    WITH abc AS
    (

    11 SELECT ID, ' he is suffereing
    jaundice"summary FROM DUAL
    UNION ALL
    Order 12, "we can go to the bus stop. OF THE DOUBLE
    UNION ALL
    SELECT 22, 'a mΦnsoon is provided affect≈the region during the next φ a few days' OF the DOUBLE
    UNION ALL
    SELECT 16, "Film¶city looks like go§d." DOUBLE
    UNION ALL
    SELECT 21, "The International @l ¥ mpic Committee moved the bike could Calm fears scratching the Olympic Games." OF THE DOUBLE
    UNION ALL
    SELECT 17, ' John F Kenny was a "young president" America "OF the DOUBLE
    UNION ALL
    18 SELECT, ' the Department of elections, identified (10) polling stations for voters to go to
    thei\r January 26 vote for the by-election of Punggol East Single Member constituency ' FROM DUAL
    UNION ALL
    SELECT 19, "the pilot of the helicopter that + crashed in Central London were thousands of"
    hours of experience of aviation including flight % for films such as die another day and save #Private #Ryan?' THE DOUBLE)
    Select id, summary, 'show special char' in splch
    ABC
    ;

    OUTPUT
    SUMMARY of the splch ID

    Film¶City 16 looks like go§d. ¶§
    21 the International @l ¥ mpic Committee moved the bike could Calm fears scratching the Olympic Games. @¥ O
    22 a mΦnsoon is planned for the region during the next φ affect≈the days Φ≈φ

    Hello

    Here's one way:

    WITH     got_special_characters     AS
    (
         SELECT  id
         ,     summary
         ,     REGEXP_REPLACE ( summary
                          , '[][[:alnum:],: ()''"./\+%?#'  ||
                                CHR (10)                ||
                         '-]'
                          )     AS special_characters
         FROM    abc
    )
    SELECT       id
    ,       summary
    ,       special_characters
    FROM       got_special_characters
    WHERE       special_characters     IS NOT NULL
    ORDER BY  id
    ;
    {code}
    Inside square brackets, the characers ']' and '-' have special meanings, unless you use them in places where the special meaning can't apply.  That means the ']' must be the first character inside the square brackets (Oracle assumes you're not ending the set right after you begin it) and the '-' must be the very last character inside the square brackets.
    Depending on what newline is on your system, you may want to use CHR (13) in addition to, or instead of, CHR (10).
    
    it would be more efficient to use the TRANSLATE fucntion, rather than REGEXP_REPLACE, to produce special_characters.  You'd have to list all 80 or so of the non-special characters, but you'd only have to do it once.
    {code}
    WITH     got_special_characters     AS
    (
         SELECT  id
         ,     summary
         ,     TRANSLATE ( summary
                     , '=0123456789ABCEDFGHIJKLMNOPQRSTUVWXYZabcedfghijklmnopqrstuvwxyz,: -[]()''"./\+%?#'
                           || CHR (10)
                     , '='
                     )     AS special_characters
         FROM    abc
    )
    SELECT       id
    ,       summary
    ,       special_characters
    FROM       got_special_characters
    WHERE       special_characters     IS NOT NULL
    ORDER BY  id
    ;
    

    Published by: Frank Kulash on 16 January 2013 12:35
    TRANSLATE the code added.

  • Invoice number with a special character

    Hi team,

    We have a requirement to compare the invoice number of the child database data.

    We save the master invoice number in the variable to access the data of the child.

    Our number is the invoice number is to have either a special character '-' because of which equal to the function does not work.

    Pourrait a guide on this issue.

    Here is the code
    ? xdoxslt:set_variable($_XDOCTX,_'v1',_ssInvoiceNumber)? >

    <? If: (xdoxslt:get_variable($_XDOCTX,'v1') = ssInvoiceNumber)? > View the data <? end if? >

    Even if the data are not same the run loop if and its unwanted display of data.

    The invoice number as (1-100678, 1-100677, 1-100679).

    See you soon,.
    Andy

    want to remove numbers HYPHEN before compare it?

    use

    
    

    to remove the HYPHEN

    
    
  • special character

    Hello

    in the groovy code,.

    I want to write

    FTRInstructionResult where (name = 'a' name')

    But ' nme contains an apostrophe. Foglight doesn't. How to tell foglight is a special character? And not the end of the expression.

    Thank you.

    The ITI is not Foglight who dislikes your characters

    It's groovy or java string syntax. If you wish to escape the Apostrophe with a backslash as follows

    ' a\ 'name '.

    Stefan

  • Change order number/special character artists

    I would like to know if there is a way to change the order of all the artists that begin with a number or a special character order. Currently, they are all sitting at the bottom of the list of the artist on the ipod (and iTunes) but I would like to have all displays at the top of this list.

    This is the sort order...  I think you would need to change the names of the artists so that they start with something that gets sorted at the top of the list in alphanumeric order.  For example, replace 10,000 Maniacs a_10, 000 Maniacs.

Maybe you are looking for