Jump to content

Formatting strings to send to MySQL


phaldenby

Recommended Posts

I have grabbed a few variables into php from Flash.
They make it to php fine, I can print or echo them no problem.
When I try to send them to my MySQL table, I get "<TEXTFORMAT LEA" in any field that I tried to write to.

I noticed that when I print or echo it from php it is formatted like this:
<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">chek</FONT></P></TEXTFORMAT>
This must be how it is getting it from Flash

Here is the PHP code:

    $fname = $_POST['nbox']; //grabbing from falsh

    //then I connect to the the DB

    mysql_query("INSERT INTO users (firstName)
    VALUES ('$fname')");

Here is the Flash statement:

    on (release) {
    getURL("email.php", "_blank", "POST");
    }

Is there a way (in php or even flash) that I can turn this formatted text into the sort of text that MySQL will accept?

Link to comment
https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/
Share on other sites

your right!
Its just truncating, thats why is see <TEXTFORMAT LEA
is there a way to just get the text that I want, the "check" from:
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">check</FONT></P></TEXTFORMAT>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.