help passing string with spaces
| From: | Zen Rodeo | Date: | Thu, 24 Aug 2000 01:56:37 +0000 |
| Subject: | help passing string with spaces | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-13280@lists.php.net to get a copy of this message | ||
Here's some code to print some data from MySQL into a
table data cell. The idea is you click on the link to
see the entire row:
printf ("<a
href=\"show_more.php?d_title=%s\">%s</a></td>",
($val), ($val));
And here's the code from show_more.php that's supposed
to bring up the entire row :
$my_query = "SELECT * FROM driver WHERE driver_title =
'$d_title'";
This all works fine when the data is a short string
like Major. But the page containing the SQL query
doesn't see the whole string $d_title when the string
is Major Tom. It doesn't like the empty chars.
However, in the URL area of the browser window, the
entire string is visible, and of course it's visible
in the table.
We're using PHP4 with magic_quotes_gpc = on. Tried
addslashes, stripslashes, urlencode, etc.
How can the entire string be passed to the next page
and then used successfully in a SQL query?
Thank you.
__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/