In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> Just a noob php/mysql question... (I suppose)
>
> When I try just putting php code in my insert queries, it goes like this:
>
> insert into mytable values('<?php echo "some string"; ?>')
>
> select * from mytable, returns:
> <?php echo "some string"; ?>Some string
>
> So the insert-query inserts both the code AND the string that the code
> echoes...
>
> Any help would be greatly appreciated!
You haven't given enough code to know excatly what your problem is.
However, for an educated guess, try something like:
$sql = "INSERT INTO mytable VALUES(" . $mystring . ")";
where of course $mystring is the correctly formatted set of values to
insert. Note that using this method you must have a value for each field
in the table, in the order in which the fields appear in the table.
--
David Robley
Temporary Kiwi!
Quod subigo farinam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php