tollen Wrote:
-------------------------------------------------------
> Lord Cupid Wrote:
> --------------------------------------------------
> -----
> > Parse error: syntax error, unexpected
> > T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
> or
> > T_VARIABLE or T_NUM_STRING in
> > /cupidscrystals.com/public_html/Apps/db_io.html
> on
> > line 39
> >
> >
> > mysql_query("insert into $cmchat_GLOBL['DB_TABLE']
> > values ($User_Data)"
;
> >
> >
> > What exactly is wrong with this coding?
>
>
Ok, after much research and many tutorials later, here's the answer:
$query="INSERT INTO ". $cmchat_GLOBL['DB_TABLE']." VALUES (". $User_Data ."
";
$results=mysql_query($query,$con) or die("Unable to insert ". mysql_error());
See, the trick is to embed your command request and variables into a string, such as $query. That way, when the php file gets parsed, the string value you used meets all of the criterion of the mysql_query command.
The way I originally had it, the command line was jumping in and out of string value. This way just described, has the whole thing as one big string!
Peace, Grace & Love;
Lord Cupid