Need a little help, SQL PHP
Posted: Wed Oct 12, 2011 8:29 am
I've got a query which runs fine except for 2 rows which are not being picked up.
The two with the problem have an & in the name.
This is the query:
The issue is that the two category names with an ' & ' in are not being picked up.
Any ideas why this would be? As if I query:
[text]select * from wp_wpsc_product_categories where name = 'This & That'[/text]
The query runs fine in my phpmyadmin.
Help would be wonderful.
Kinda regards,
Aravona
The two with the problem have an & in the name.
This is the query:
Code: Select all
$name2 = wpsc_category_name();
$query2 = "select id from wp_wpsc_product_categories where name = '" .$name2. "'";
echo $query2;
$result2 = mysql_query($query2);
echo $result2;
$category2 = mysql_fetch_array($result2);
echo $category2['id']; Any ideas why this would be? As if I query:
[text]select * from wp_wpsc_product_categories where name = 'This & That'[/text]
The query runs fine in my phpmyadmin.
Help would be wonderful.
Kinda regards,
Aravona