Project / Support Center
Welcome, Guest. Please login or register. November 13, 2019, 08:11: AM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  Topic: write a mysql select with variable based on URL value 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: write a mysql select with variable based on URL value  (Read 57 times)
admin
Administrator
******
Offline Offline

Posts: 166


« on: November 01, 2019, 05:46: PM »

URL Values are call year & month

mysql_select_db($database_reuniomysql, $reuniomysql);
$query_nonactive = sprintf("SELECT class.class_id, class.class_active, class.class_level, class.email_list, class.reunion_year_current, class.reunion_month, class.creation_year, class.creation_month, class.use_reason, class.creation_date, class.reunion_date, class.reunion_year, class.high_school, class.event_active, class.class_year, class.class_military_branch, class.class_contact, class.contact_email FROM class WHERE class.class_level=1 AND class.creation_year='$_GET[year]' AND class.creation_month='$_GET[month]' ORDER BY class.creation_month ASC");
$nonactive = mysql_query($query_nonactive, $reuniomysql) or die(mysql_error());
$row_nonactive = mysql_fetch_assoc($nonactive);
$totalRows_nonactive = mysql_num_rows($nonactive);

Bold is how to write the query pulling the URL values year & month

Notice the hyphens ' and where they are placed.
« Last Edit: November 01, 2019, 05:50: PM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL  |  Topic: write a mysql select with variable based on URL value « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!