Hello, just uploaded a new script, yet a couple of problems,
if you go to: http://numberthree.netne.net/login.php
then Click on Stores at the top of the page and you will see one of the problems,
your help appreciated
Hello, just uploaded a new script, yet a couple of problems,
if you go to: http://numberthree.netne.net/login.php
then Click on Stores at the top of the page and you will see one of the problems,
your help appreciated
Hey Ray,
clicking the provide link give us âThe site is under review for malicious contentâŚâ message, so we canât review it yet.
Steve
The script shows exactly whatâs wrong.
Itâs a SQL error, caused by not having a limit start value
LIMIT , 20
Should be LIMIT 20 or LIMIT 0, 20.
Hello wonshikee, thank you for your reply
ok what do I do now?
in the stores.php I find this with a âlimitâ search
Line 111: $limit = 20;
Line 115: $limit_link = â&start=â . $start . â&limit=â . $limit;
Line 117: $pagination = paginate($start, $limit, $nb_stores, âstores.phpâ, $additional_vars . $order_link);
LIne 123: ORDER BY " . $order_field . " " . $order_type . " LIMIT " . $start . ", " . $limit);
your help appreciated
put this on line 112 and move whatâs currently on line 112 down
$start = (int) $start;
Fantastic Thank you wonshikee
that corrected the problem.
ok now the next php with a Error message is: list_site_users.php
A Mysql error has occurred while running the script:
The query you are trying to run is invalid
Mysql Error Output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 20' at line 9
SQL Query: SELECT u.user_id, u.name, u.username, u.email, u.active, u.approved, u.reg_date, u.payment_mode, u.balance, u.tax_account_type, u.tax_reg_number, u.tax_apply_exempt, u.tax_exempted, u.is_seller, u.preferred_seller, u.auction_approval, u.seller_verified, u.preferred_seller_exp_date, u.tax_company_name, c.name AS country_name, s.name AS state_name, u.mail_activated, u.bidder_verified FROM users u LEFT JOIN countries c ON u.country=c.id LEFT JOIN countries s ON u.state=s.id ORDER BY u.reg_date DESC LIMIT , 20
âŚ
here is a limit search on the list_site_users.php
Line 45: $balance_v2 = 1; ## balance limit (debit balance option)
Line 156: c.parent_id=0 ORDER BY c.country_order ASC, c.name ASC LIMIT 1", âidâ);
Line 416: $limit = 20;
Line 423: $limit_link = â&start=â . $start . â&limit=â . $limit;
Line 527: $template->set(âquery_results_messageâ, display_pagination_results($start, $limit, $nb_users));
Line 537: ORDER BY " . $order_field . " " . $order_type . " LIMIT " . $start . ", " . $limit);
Line 726: $pagination = paginate($start, $limit, $nb_users, âlist_site_users.phpâ, $additional_vars . $order_link . $show_link);
Line 733: $template->set(âpage_order_usernameâ, page_order(âlist_site_users.phpâ, âu.usernameâ, $start, $limit, $additional_vars . $show_link,AMSG_USERNAME));
Line 734: $template->set(âpage_order_reg_dateâ, page_order(âlist_site_users.phpâ, âu.reg_dateâ, $start, $limit, $additional_vars . $show_link, AMSG_REG_DATE));
remove the , between LIMIT and 20
For starters you need to do the same thing you did to the other page here on line 417 this time because youâre filling limit with a variable. So long as that variable is either there or unassigned youâll throw an SQL error.
Thank you Belsnickle, I thought to add the $start = (int) $start; line, just was not 100% sure,
I have added it, and the list_site_users.php is loading fine now
Now if you could help me solve the problem on the Sell and Wanted Ads pages.
http://numberthree.netne.net/index.php
On the Sell & Wanted Ads pages, you need to Select a Category. eg: Art - Modern
the Category Select does not complete, no On Click,
you will need to Register to access the Sell & Wanted Ads pages.
or PM me and I will send you a Log In Username & Password
all help and ideas greatly appreciated
Hello
this is the Error message for the php shown below,
I have corrected other Errors, by adding: $start = (int) $start;
$limit = 20;
$start = (int) $start;
yet this php has no $limit = 20; line
your help appreciated
âŚ
A Mysql error has occurred while running the script:
The query you are trying to run is invalid
Mysql Error Output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10' at line 8
SQL Query: SELECT a.auction_id, a.name, a.start_price, a.max_bid, a.nb_bids, a.currency, a.end_time, a.closed, a.bold, a.hl, a.buyout_price, a.is_offer, a.reserve_price, a.owner_id, a.postage_amount, a.fb_current_bid, a.auction_type, a.start_time, a.is_relisted_item, a.enable_swap FROM auctions a FORCE INDEX(auctions_start_time) LEFT JOIN users u ON u.user_id=a.owner_id WHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0 AND a.creation_in_progress=0 AND a.list_in!='store' AND a.closed=0 AND (a.list_in='auction' OR u.shop_active='1') GROUP BY a.auction_id ORDER BY a.start_time DESC LIMIT , 10
âŚ
<?
#################################################################
##-------------------------------------------------------------##
##-------------------------------------------------------------##
#################################################################
session_start();
define (âIN_SITEâ, 1);
include_once (âincludes/global.phpâ);
include_once (âglobal_header.phpâ);
$option = (in_array($_REQUEST[âoptionâ], array(âfeaturedâ, ârecentâ, âpopularâ, âendingâ))) ? $_REQUEST[âoptionâ] : âpopularâ;
switch ($option)
{
case âfeaturedâ:
$page_header_msg = MSG_FEATURED_AUCTIONS;
$where_query = âWHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND
a.list_in!=âstoreâ AND a.close_in_progress=0 AND a.hpfeat=1â;
$order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.end_time';
$order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC';
break;
case 'recent':
$page_header_msg = MSG_RECENTLY_LISTED_AUCTIONS;
$where_query = "WHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0 AND
a.creation_in_progress=0 AND a.list_in!='store'";
$order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.start_time';
$order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC';
break;
case 'popular':
$page_header_msg = MSG_POPULAR_AUCTIONS;
$where_query = "WHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND
a.list_in!='store' AND a.creation_in_progress=0 AND a.nb_bids>0 ";
//"WHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0 AND a.crea"
$order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.max_bid';
$order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC';
break;
case 'ending':
$page_header_msg = MSG_ENDING_SOON_AUCTIONS;
$where_query = "WHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND
a.list_in!='store' AND a.creation_in_progress=0";
$order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.end_time';
$order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC';
break;
}
$header_browse_auctions = header5($page_header_msg);
/**
$order_field = (in_array($order_field, $auction_ordering)) ? $order_field : âa.end_timeâ;
$order_type = (in_array($order_type, $order_types)) ? $order_type : âASCâ;
$additional_vars = â&option=â . $_REQUEST[âoptionâ];
include_once(âincludes/page_browse_auctions.phpâ);
include_once (âglobal_footer.phpâ);
echo $template_output;
?>
You should take the time to understand why my solution (or even my first response) fixes your problem.
Once you understand it, you will be able to apply it to this problem as well.
Hello wonshikee
yes you are correct, I would like to understand the why, and how to fix,
ok so in the first Error we had: DESC LIMIT , 20 (use near â 20â at line 9)
this time I have: DESC LIMIT , 10 (use near â 10â at line 8)
you said: âŚ
The script shows exactly whatâs wrong.
Itâs a SQL error, caused by not having a limit start value
LIMIT , 20
Should be LIMIT 20 or LIMIT 0, 20.
âŚ
so this php is also missing a Limit Start value ?
Hello wonshikee
ok after lots of looking and trying to understand why I placed the ($start = (int) $start;) code 4 times here,
##-------------------------------------------------------------##
#################################################################
session_start();
define (âIN_SITEâ, 1);
include_once (âincludes/global.phpâ);
include_once (âglobal_header.phpâ);
$option = (in_array($_REQUEST[âoptionâ], array(âfeaturedâ, ârecentâ, âpopularâ, âendingâ))) ? $_REQUEST[âoptionâ] : âpopularâ;
switch ($option)
{
case âfeaturedâ:
$page_header_msg = MSG_FEATURED_AUCTIONS;
$where_query = âWHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND
a.list_in!=âstoreâ AND a.close_in_progress=0 AND a.hpfeat=1â;
$start = (int) $start;
$order_field = ($_REQUEST[âorder_fieldâ]) ? $_REQUEST[âorder_fieldâ] : âa.end_timeâ;
$order_type = ($_REQUEST[âorder_typeâ]) ? $_REQUEST[âorder_typeâ] : âASCâ;
break;
case ârecentâ:
$page_header_msg = MSG_RECENTLY_LISTED_AUCTIONS;
$where_query = âWHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0 AND
a.creation_in_progress=0 AND a.list_in!=âstoreââ;
$start = (int) $start;
$order_field = ($_REQUEST[âorder_fieldâ]) ? $_REQUEST[âorder_fieldâ] : âa.start_timeâ;
$order_type = ($_REQUEST[âorder_typeâ]) ? $_REQUEST[âorder_typeâ] : âDESCâ;
break;
case âpopularâ:
$page_header_msg = MSG_POPULAR_AUCTIONS;
$where_query = "WHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND
a.list_in!=âstoreâ AND a.creation_in_progress=0 AND a.nb_bids>0 ";
//âWHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0 AND a.creaâ
$start = (int) $start;
$order_field = ($_REQUEST[âorder_fieldâ]) ? $_REQUEST[âorder_fieldâ] : âa.max_bidâ;
$order_type = ($_REQUEST[âorder_typeâ]) ? $_REQUEST[âorder_typeâ] : âDESCâ;
break;
case âendingâ:
$page_header_msg = MSG_ENDING_SOON_AUCTIONS;
$where_query = âWHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND
a.list_in!=âstoreâ AND a.creation_in_progress=0â;
$start = (int) $start;
$order_field = ($_REQUEST[âorder_fieldâ]) ? $_REQUEST[âorder_fieldâ] : âa.end_timeâ;
$order_type = ($_REQUEST[âorder_typeâ]) ? $_REQUEST[âorder_typeâ] : âASCâ;
break;
}
$header_browse_auctions = header5($page_header_msg);
/**
$order_field = (in_array($order_field, $auction_ordering)) ? $order_field : âa.end_timeâ;
$order_type = (in_array($order_type, $order_types)) ? $order_type : âASCâ;
$additional_vars = â&option=â . $_REQUEST[âoptionâ];
include_once(âincludes/page_browse_auctions.phpâ);
include_once (âglobal_footer.phpâ);
echo $template_output;
and it worked!
thank you
You sure?
http://numberthree.netne.net/categories.php?category=antiques-and-art&parent_id=215
A Mysql error has occurred while running the script:
The query you are trying to run is invalid
Mysql Error Output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10' at line 7
SQL Query: SELECT a.auction_id, a.name, a.start_price, a.max_bid, a.nb_bids, a.currency, a.end_time, a.closed, a.bold, a.hl, a.buyout_price, a.is_offer, a.reserve_price, a.owner_id, a.postage_amount, a.fb_current_bid, a.auction_type, a.start_time, a.is_relisted_item, a.enable_swap FROM auctions a LEFT JOIN users u ON u.user_id=a.owner_id WHERE a.active=1 AND a.approved=1 AND a.deleted=0 AND a.creation_in_progress=0 AND a.closed=0 AND (a.category_id IN (215, 216, 217, 218, 219, 220, 221, 222, 224, 223, 225, 226, 227, 228, 229, 230, 232, 231, 237, 233, 234, 235, 236, 238, 239, 240, 241, 242, 255, 243, 244, 245, 247, 248, 249, 246, 250, 254, 251, 252, 253, 256, 257, 258, 259, 261, 260, 262) OR a.addl_category_id IN (215, 216, 217, 218, 219, 220, 221, 222, 224, 223, 225, 226, 227, 228, 229, 230, 232, 231, 237, 233, 234, 235, 236, 238, 239, 240, 241, 242, 255, 243, 244, 245, 247, 248, 249, 246, 250, 254, 251, 252, 253, 256, 257, 258, 259, 261, 260, 262)) AND (a.list_in='auction' OR u.shop_active='1') GROUP BY a.auction_id ORDER BY a.list_in ASC, a.end_time ASC LIMIT , 10
http://numberthree.netne.net/categories.php?category=collectables&parent_id=669
A Mysql error has occurred while running the script:
The query you are trying to run is invalid
Mysql Error Output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 10' at line 7
SQL Query: SELECT a.auction_id, a.name, a.start_price, a.max_bid, a.nb_bids, a.currency, a.end_time, a.closed, a.bold, a.hl, a.buyout_price, a.is_offer, a.reserve_price, a.owner_id, a.postage_amount, a.fb_current_bid, a.auction_type, a.start_time, a.is_relisted_item, a.enable_swap FROM auctions a LEFT JOIN users u ON u.user_id=a.owner_id WHERE a.active=1 AND a.approved=1 AND a.deleted=0 AND a.creation_in_progress=0 AND a.closed=0 AND (a.category_id IN (669, 670, 672, 673, 674, 676, 677, 675, 678, 679, 680, 681, 671, 682, 688, 683, 684, 685, 686, 687, 2293, 689, 691, 692, 694, 693, 696, 695, 690, 697, 698, 699, 700, 703, 702, 701, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 715, 716, 717, 714, 718, 719, 720, 728, 721, 722, 723, 724, 725, 726, 727, 729, 731, 733, 732, 730, 734, 735, 736, 738, 737, 740, 741, 739, 742, 743, 746, 744, 745, 747, 749, 748, 750, 751, 752, 1878, 1880, 1881, 1882, 1902, 1883, 1884, 1885, 1886, 1887, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 769, 768, 770, 774, 773, 775, 771, 772, 776, 777, 778, 779, 781, 782, 780, 783, 784, 785, 786, 787, 789, 788, 790, 791, 792, 793, 794, 795, 796, 797, 799, 800, 801, 802, 803, 798, 804, 805, 806, 807, 809, 808, 812, 810, 811, 858, 859, 860, 861, 814, 813, 815, 753, 755, 754, 757, 756, 816, 817, 818, 819, 820, 825, 821, 823, 824, 822, 826, 828, 829, 830, 827, 836, 831, 833, 832, 834, 835, 843, 844, 1879, 1888, 1889, 1890, 1899, 1891, 1892, 1898, 1897, 1901, 1894, 1893, 1900, 1896, 1895, 837, 839, 840, 838, 841, 842, 845, 847, 846, 848, 849, 850, 851, 854, 856, 855, 852, 857, 853, 862, 863, 865, 866, 864, 867, 868, 869, 873, 870, 874, 876, 875, 872, 871) OR a.addl_category_id IN (669, 670, 672, 673, 674, 676, 677, 675, 678, 679, 680, 681, 671, 682, 688, 683, 684, 685, 686, 687, 2293, 689, 691, 692, 694, 693, 696, 695, 690, 697, 698, 699, 700, 703, 702, 701, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 715, 716, 717, 714, 718, 719, 720, 728, 721, 722, 723, 724, 725, 726, 727, 729, 731, 733, 732, 730, 734, 735, 736, 738, 737, 740, 741, 739, 742, 743, 746, 744, 745, 747, 749, 748, 750, 751, 752, 1878, 1880, 1881, 1882, 1902, 1883, 1884, 1885, 1886, 1887, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 769, 768, 770, 774, 773, 775, 771, 772, 776, 777, 778, 779, 781, 782, 780, 783, 784, 785, 786, 787, 789, 788, 790, 791, 792, 793, 794, 795, 796, 797, 799, 800, 801, 802, 803, 798, 804, 805, 806, 807, 809, 808, 812, 810, 811, 858, 859, 860, 861, 814, 813, 815, 753, 755, 754, 757, 756, 816, 817, 818, 819, 820, 825, 821, 823, 824, 822, 826, 828, 829, 830, 827, 836, 831, 833, 832, 834, 835, 843, 844, 1879, 1888, 1889, 1890, 1899, 1891, 1892, 1898, 1897, 1901, 1894, 1893, 1900, 1896, 1895, 837, 839, 840, 838, 841, 842, 845, 847, 846, 848, 849, 850, 851, 854, 856, 855, 852, 857, 853, 862, 863, 865, 866, 864, 867, 868, 869, 873, 870, 874, 876, 875, 872, 871)) AND (a.list_in='auction' OR u.shop_active='1') GROUP BY a.auction_id ORDER BY a.list_in ASC, a.end_time ASC LIMIT , 10
Looks like the same problem - LIMIT , 10. Check your other pages/scripts.
Hello centered effect
thank you for looking in at my site,
below is the categories.php
all help appreciated
<?
#################################################################
##-------------------------------------------------------------##
##-------------------------------------------------------------##
#################################################################
session_start();
define (âIN_SITEâ, 1);
include_once (âincludes/global.phpâ);
include_once (âincludes/class_formchecker.phpâ);
include_once (âincludes/class_custom_field.phpâ);
$parent_id = intval($_REQUEST[âparent_idâ]);
$is_category = $db->count_rows(âcategoriesâ, âWHERE category_id='â . $parent_id . â'â);
$parent_id = ($is_category) ? $parent_id : 0;
$_REQUEST[âparent_idâ] = $parent_id;
$user_id = intval($_REQUEST[âuser_idâ]);
$protected_page = protected_page(0, $parent_id);
if ($protected_page[âprivate_categoryâ] && !category_logged_in($parent_id))
{
header_redirect(âprotected_page.php?redirect_url=categories&category_id=â . $parent_id);
}
else
{
include_once (âglobal_header.phpâ);
$template->set('parent_id', $parent_id);
define('IS_CATEGORIES', 1);
$main_category_id = $db->main_category($parent_id);
$category_details = $db->get_sql_row("SELECT image_path, minimum_age FROM " . DB_PREFIX . "categories
WHERE category_id='" . $main_category_id . "'");
$category_logo = $category_details['image_path'];
$category_logo = (!empty($category_logo)) ? '<img src="' . $category_logo . '" border="0">' : '';
$template->set('category_logo', $category_logo);
$categories_header_menu = category_navigator($parent_id, true, true, 'categories.php');
$template->set('categories_header_menu', $categories_header_menu);
if ($_REQUEST['option'] == 'agree_adult')
{
$session->set('adult_category', 1);
}
if ($category_details['minimum_age'] > 0 && !$session->value('adult_category'))
{
$template->set('minimum_age', $category_details['minimum_age']);
$template_output .= $template->process('adult_category_warning.tpl.php');
}
else
{
$src_details = array_merge($_GET, $_POST);
$src_details = $db->rem_special_chars_array($src_details);
/**
* featured items, recently listed and ending soon code
*/
if ($layout['catfeat_nb'])
{
(array) $item_details = null;
$where_query = " WHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0
AND a.list_in!='store' AND a.catfeat='1'";
$where_query = browse_filter_query($src_details, $where_query);
$template->set('featured_columns', min((floor($db->count_rows('auctions a', $select_condition)/$layout['catfeat_nb']) + 1), ceil($layout['catfeat_max']/$layout['catfeat_nb'])));
$item_details = $db->random_rows('auctions a', 'a.auction_id, a.name, a.start_price, a.max_bid, a.currency, a.end_time', $where_query, $layout['catfeat_max']);
$template->set('item_details', $item_details);
}
/**
* shop in stores code snippet
*/
if ($parent_id)
{
$where_query = " WHERE a.active=1 AND a.approved=1
AND a.closed=0 AND a.deleted=0 AND a.list_in!='auction'
AND a.owner_id=us.user_id AND us.active='1' AND us.shop_active='1' AND us.shop_name!=''";
$where_query = browse_filter_query($src_details, $where_query);
$sql_select_stores = $db->query("SELECT us.user_id, us.shop_name FROM
" . DB_PREFIX . "users us, " . DB_PREFIX . "auctions a
" . $where_query . "
GROUP BY us.user_id");
$is_shop_stores = $db->num_rows($sql_select_stores);
$template->set('is_shop_stores', $is_shop_stores);
if ($is_shop_stores)
{
(string) $shop_stores_content = null;
while ($store_details = $db->fetch_array($sql_select_stores))
{
$background = ($counter++%2) ? 'c1' : 'c2';
$shop_stores_content .= '<tr> '.
' <td width="100%" class="contentfont"> » <a href="shop.php?user_id=' . $store_details['user_id'] . '&parent_id=' . $parent_id . '">' . $store_details['shop_name'] . '</a></td> '.
'</tr> ';
}
$template->set('shop_stores_content', $shop_stores_content);
}
}
$categories_header .= $template->process('categories_header.tpl.php');
$categories_footer = $template->process('categories_footer.tpl.php');
/**
* below we have the variables that need to be declared in each separate browse page
*/
$page_url = 'categories';
$where_query = " WHERE a.active=1 AND a.approved=1 AND a.deleted=0 AND a.creation_in_progress=0";
$order_field = (in_array($_REQUEST['order_field'], $auction_ordering)) ? $_REQUEST['order_field'] : 'a.end_time';
$order_type = (in_array($_REQUEST['order_type'], $order_types)) ? $_REQUEST['order_type'] : 'ASC';
$template->set('categories_header', $categories_header);
$template->set('categories_footer', $categories_footer);
include_once('includes/page_browse_auctions.php');
}
include_once ('global_footer.php');
echo $template_output;
}
?>
Ok I seem to have corrected it by adding the red line below
/**
$where_query = " WHERE a.active=1 AND a.approved=1 AND a.deleted=0 AND a.creation_in_progress=0";
$start = (int) $start;
$order_field = (in_array($_REQUEST[âorder_fieldâ], $auction_ordering)) ? $_REQUEST[âorder_fieldâ] : âa.end_timeâ;
$order_type = (in_array($_REQUEST[âorder_typeâ], $order_types)) ? $_REQUEST[âorder_typeâ] : âASCâ;
$template->set(âcategories_headerâ, $categories_header);
$template->set(âcategories_footerâ, $categories_footer);
include_once(âincludes/page_browse_auctions.phpâ);
}
include_once (âglobal_footer.phpâ);
echo $template_output;
}
?>