
jonnyfortis
Members-
Posts
41 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
jonnyfortis's Achievements

Member (2/5)
0
Reputation
-
i have a student register for attendance, down the side will be their names, across the top i will be showing each single day (example tuesday) from three month date range currently the code just echoes out all the Tuesdays as an array from the three month date range. i need to be able to use the individual date to add them to the database based on weather they student has attended. i know how to do this i just need to know how i can use the dates individually. function getDatesFromRange($start, $end) { $interval = new DateInterval('P1D'); $realEnd = new DateTime($end); $realEnd->add($interval); $period = new DatePeriod( new DateTime($start), $interval, $realEnd ); foreach($period as $date) { $array[] = $date->format('Y-m-d'); } return $array; } // Call the function $dates = getDatesFromRange('2016-04-01', '2016-07-01'); // Print the output print_r($dates);
-
duplicated webpage does not show wordpress blog
jonnyfortis replied to jonnyfortis's topic in Applications
let me explain a little further. when i load the home1.php all the page shows up except the wordpress blog, that is not being included. i am not using wordpress as an editor. this was something built by someone else. to me it looks like there must be something in wordpress that is saying use home.php -
Hi have a webpage (homepage) that has a wordpress blog linked to it. when i save the page exactly as it is for example. home.php then saves as home1.php and load the home1.php the wordpress blog is missing. i dont use wordpress normally this is a site i have been sent to amend some part in php. Is the reason for this wordpress backend is pointing to the home.php? here is the code for the blog <div class="blog_container"> <a href="/blog" class="title_link">Latest Blog Posts</a> <? if ($posts) { ?> <ul> <? foreach ($posts as $post) { ?> <li> <a href="<?= $post->guid ?>"> <?= word_limiter($post->post_title, 10) ?> <span><?= date('d-m-Y', strtotime($post->post_date)) ?></span> <strong>read more ></strong> </a> </li> <? } ?> </ul> <? } ?> </div> thanks
-
i am trying WHERE DATE_FORMAT(host_payments2014.payment_paid_timestamp, '%m/%d/%y') >= '2014-06-12' but am getting an error from another part of the page. Warning: Division by zero in the line of code is. $additional1 = $row_rsPayment['payment_amount_paid'] / $row_rsPayment['rental_price']; // divide this by property week amount ;
-
yes it currently is stored as VARCHAR, i need to change it to DATE but this issue i am having is the return date from the bank is MM/DD/YY and the date format is 0000-00-00 in phpMyAdmin and i not sure if the return date will populate the column correctly.
-
i have a table that shows payments made but want to the payments only showing from a set date(06/12/14) and before this date i dont want to show this is my sql that doesnt seem to work and is showing dates before the specified date. . "SELECT * FROM payments2014, signup2014, editprop2014 WHERE signup2014.userid = payments2014.payment_userid AND editprop2014.prop_id = signup2014.prop_id AND signup2014.userid !='page1' AND signup2014.userid !='page6' AND signup2014.userid !='page4' AND payments2014.payment_transaction_status !='none' AND payments2014.payment_transaction_status !='CANCELLEDa' AND payments2014.payment_type !='deposit' AND payments2014.payment_paid_timestamp NOT LIKE '%2012%' AND payments2014.payment_paid_timestamp NOT LIKE '%2011%' AND payments2014.payment_paid_timestamp >= '06/12/14' ORDER BY payments2014.payment_id DESC" i have some other parts in the statment but this one that should be filtering is host_payments2014.payment_paid_timestamp >= '06/12/14' thanks in advance
-
select menu to show record selected on same page
jonnyfortis replied to jonnyfortis's topic in PHP Coding Help
hello thanks for the help i have tried the following now <form id="form1" name="form1" method="GET" action=""> <label for="select"></label> <select name="select" id="select"> <?php do { ?> <option value="<?php echo $row_rsCountries['stockistLocID']?>"><?php echo $row_rsCountries['stockistLocName']?></option> <?php } while ($row_rsCountries = mysql_fetch_assoc($rsCountries)); $rows = mysql_num_rows($rsCountries); if($rows > 0) { mysql_data_seek($rsCountries, 0); $row_rsCountries = mysql_fetch_assoc($rsCountries); } ?> </select> <input type="submit" name="button" id="button" value="go" /> </form> and the query i have done is $var1_rsStockists = "-1"; if (isset($_GET['recordID'])) { $var1_rsStockists = $_GET['recordID']; } mysql_select_db($database_beau, $beau); $query_rsStockists = sprintf("SELECT * FROM beauAW13_stockist, beauAW13_stockistLoc WHERE beauAW13_stockist.stockistLocID = beauAW13_stockistLoc.stockistLocID AND beauAW13_stockistLoc.stockistLocID = %s", GetSQLValueString($var1_rsStockists, "int")); $rsStockists = mysql_query($query_rsStockists, $beau) or die(mysql_error()); $row_rsStockists = mysql_fetch_assoc($rsStockists); $totalRows_rsStockists = mysql_num_rows($rsStockists); mysql_select_db($database_beau, $beau); $query_rsCountries = "SELECT * FROM beauAW13_stockistLoc"; $rsCountries = mysql_query($query_rsCountries, $beau) or die(mysql_error()); $row_rsCountries = mysql_fetch_assoc($rsCountries); $totalRows_rsCountries = mysql_num_rows($rsCountries); but when the form is submitted no information is returned -
I have dynamic select list that is populated with countries (each country has information (shops) that is associated it. When the country is selected i want the shop information to show below then menu. the statement for the shop is mysql_select_db($database_beau, $beau); $query_rsStockists = "SELECT * FROM beauAW13_stockist, beauAW13_stockistLoc WHERE beauAW13_stockist.stockistLocID = beauAW13_stockistLoc.stockistLocID"; $rsStockists = mysql_query($query_rsStockists, $beau) or die(mysql_error()); $row_rsStockists = mysql_fetch_assoc($rsStockists); $totalRows_rsStockists = mysql_num_rows($rsStockists); mysql_select_db($database_beau, $beau); $query_rsCountries = "SELECT * FROM beauAW13_stockistLoc"; $rsCountries = mysql_query($query_rsCountries, $beau) or die(mysql_error()); $row_rsCountries = mysql_fetch_assoc($rsCountries); $totalRows_rsCountries = mysql_num_rows($rsCountries); the select list is <form id="form1" name="form1" method="post" action=""> <label for="select"></label> <select name="select" id="select"> <?php do { ?> <option value="<?php echo $row_rsCountries['stockistLocID']?>"><?php echo $row_rsCountries['stockistLocName']?></option> <?php } while ($row_rsCountries = mysql_fetch_assoc($rsCountries)); $rows = mysql_num_rows($rsCountries); if($rows > 0) { mysql_data_seek($rsCountries, 0); $row_rsCountries = mysql_fetch_assoc($rsCountries); } ?> </select> <input type="submit" name="button" id="button" value="go" /> </form> and the shop information that i want to appear below is <p><?php echo $row_rsStockists['stockistName']; ?><br /> <?php echo $row_rsStockists['stockistAdd1']; ?><br /> <?php echo $row_rsStockists['stockistTown']; ?><br /> <?php echo $row_rsStockists['stockistCounty']; ?><br /> <?php echo $row_rsStockists['stockistCountry']; ?><br /> <?php echo $row_rsStockists['stockistPostCode']; ?><br /> <?php echo $row_rsStockists['stockistWWW']; ?></p> thanks for you help in advance
-
Retrieve table data based on a single variable
jonnyfortis replied to jonnyfortis's topic in PHP Coding Help
sorry a bit vague, yes there is no output yes all the IDs are corrected and the tables are related.. -
Retrieve table data based on a single variable
jonnyfortis replied to jonnyfortis's topic in PHP Coding Help
sorry, yes that is the value from the select list.it is put into an array that is in the code above $XC_BindingValues=array("size2","ProductID","size2","1","Product","Price","Stock",""); -
Retrieve table data based on a single variable
jonnyfortis replied to jonnyfortis's topic in PHP Coding Help
yes i get that bit but need to know how to make that query to get all the data based on that $XCart_StockID variable -
Retrieve table data based on a single variable
jonnyfortis replied to jonnyfortis's topic in PHP Coding Help
thanks here is the product description page. including the select list that needs to pass the stockID // *** X Shopping Cart *** $useSessions = false; $XCName = "mejobbo"; $XCTimeout = 1; $XC_ColNames=array("StockID","ProductID","Size","Quantity","Name","Price","Stock","Total"); $XC_ComputedCols=array("","","","","","","","Price"); require_once('XCInc/XCart.inc'); $var1_rsProduct = "-1"; if (isset($_GET['productID'])) { $var1_rsProduct = $_GET['productID']; } mysql_select_db($database_mejobbo, $mejobbo); $query_rsProduct = sprintf("SELECT * FROM mejobboAW13_Cat, mejobboAW13_products, mejobboAW13_Stock, mejobboAW13_SizeList WHERE mejobboAW13_products.catID = mejobboAW13_Cat.catID AND mejobboAW13_products.ProductID = mejobboAW13_Stock.ProductID AND mejobboAW13_Stock.SizeID = mejobboAW13_SizeList.SizeID AND mejobboAW13_products.ProductID = %s AND mejobboAW13_Stock.Stock != 0 ", GetSQLValueString($var1_rsProduct, "int")); $rsProduct = mysql_query($query_rsProduct, $mejobbo) or die(mysql_error()); $row_rsProduct = mysql_fetch_assoc($rsProduct); $totalRows_rsProduct = mysql_num_rows($rsProduct); // *** Add item to Shopping Cart via form *** $XC_editAction1 = $_SERVER["PHP_SELF"]; if (isset($_SERVER["QUERY_STRING"])) $XC_editAction1 = $XC_editAction1 . "?" . $_SERVER["QUERY_STRING"]; if (isset($_POST["XC_addToCart"]) && $_POST["XC_addToCart"] == "form1") { $NewRS=mysql_query($query_rsProduct, $mejobbo) or die(mysql_error()); $XC_rsName="rsProduct"; // identification $XC_uniqueCol="ProductID"; $XC_redirectTo = ""; $XC_redirectPage = "../cart1.php"; $XC_BindingTypes=array("FORM","RS","FORM","LITERAL","RS","RS","RS","NONE"); $XC_BindingValues=array("size2","ProductID","size2","1","Product","Price","Stock",""); $XC_BindingLimits=array("","","","","","","",""); $XC_BindingSources=array("","","","","","","",""); $XC_BindingOpers=array("","","","","","","",""); require_once('XCInc/AddToXCartViaForm.inc'); } and the form <form action="<?php echo $XC_editAction1; ?>" method="post"> <select name="select" id="select"> <?php do { ?> <option value="<?php echo $row_rsProduct['StockID']; ?>"><?php echo $row_rsProduct['Size']?></option> <?php } while ($row_rsProduct = mysql_fetch_assoc($rsProduct)); $rows = mysql_num_rows($rsProduct); if($rows > 0) { mysql_data_seek($rsProduct, 0); $row_rsProduct = mysql_fetch_assoc($rsProduct); } ?> </select> <input type="image" src="../images/SS13AddToCart.jpg" border="0" name="submit"/></p> <input type="hidden" name="XC_recordId" value="<?php echo $row_rsProduct['ProductID']; ?>" /> <input type="hidden" name="XC_addToCart" value="form1" /> </form> then the page this is sent to is cart1.php // *** X Shopping Cart *** $useSessions = false; $XCName = "mejobbo"; $XCTimeout = 1; $XC_ColNames=array("StockID","ProductID","Size","Quantity","Name","Price","Stock","Total"); $XC_ComputedCols=array("","","","","","","","Price"); require_once('XCInc/XCart.inc'); then i tried a query to get the StockID details mysql_select_db($database_mejobbo, $mejobbo); $query_rsSize = "SELECT * FROM mejobboAW13_Stock, mejobboAW13_SizeList WHERE mejobboAW13_Stock.SizeID = mejobboAW13_SizeList.SizeID AND mejobboAW13_Stock.StockID = '$XCart_StockID'"; $rsSize = mysql_query($query_rsSize, $beau) or die(mysql_error()); $row_rsSize = mysql_fetch_assoc($rsSize); $totalRows_rsSize = mysql_num_rows($rsSize); but this didn't work then to diplay in a table <?php while($XCart__i<sizeof(${$XCName}["contents"][0])) { require('XCInc/RepeatXCartRegion.inc'); ?> <tr class="text"> <td><input name="Quantity[]" type="text" value="<?php echo $XCart_Quantity = ${$XCName}["contents"][3][$XCart__i]; ?>" size="2" maxlength="2" /></td> <td><?php echo $XCart_Name = ${$XCName}["contents"][4][$XCart__i]; ?></td> <td><?php echo $XCart_StockID = ${$XCName}["contents"][0][$XCart__i]; ?></td> <td><?php echo $XCart_Size = ${$XCName}["contents"][2][$XCart__i]; ?><?php echo $row_rsSize['Size']; ?></td> <td><?php echo DoFormatCurrency($XCart_Price = ${$XCName}["contents"][5][$XCart__i], 2, ',', '.', '£ ', ''); ?></td> <td><?php echo DoFormatCurrency($XCart_Total = ${$XCName}["contents"][7][$XCart__i], 2, ',', '.', '£ ', ''); ?></td> <td><input type="checkbox" name="xdelete<?php echo $XCart__i; ?>" value="1" /></td> </tr> <?php $XCart__i++; Next(${$XCName}["contents"][0]); } ?> is this what you asked for, thanks -
i have a variable that is passed from a select list, the value of the select list is a stockID <?php echo $XCart_StockID = ${$XCName}["contents"][0][$XCart__i]; ?> this is constructed from an array $useSessions = false; $XCName = "mejobbo"; $XCTimeout = 1; $XC_ColNames=array("StockID","ProductID","Size","Quantity","Name","Price","Stock","Total"); $XC_ComputedCols=array("","","","","","","","Price"); require_once('XCInc/XCart.inc'); i have a tables that contains joined references mejobbo_products ----------------------------- ProductID the stock table mejobbo_Stock ----------------------------- StockID ProductID SizeID and the size table mejobbo_SizeList ----------------------------- SizeID Size i need to know how to get all the data from table mejobbo_Stock based on the <?php echo $XCart_StockID; ?> variable thanks
-
hi, thanks for you response i have tried your suggestion but and not getting the results. i have put in my workings $colname_rsCustomer = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_rsCustomer = $_SESSION['MM_Username']; } mysql_select_db($database_cfs, $cfs); $query_rsCustomer = sprintf("SELECT * FROM cfsCustomers, cfsCustomersImages WHERE custEmail = %s AND cfsCustomersImages.custID = cfsCustomers.custID", GetSQLValueString($colname_rsCustomer, "text")); $query_limit_rsCustomer = sprintf("%s LIMIT %d, %d", $query_rsCustomer, $startRow_rsCustomer, $maxRows_rsCustomer); $rsCustomer = mysql_query($query_limit_rsCustomer, $cfs) or die(mysql_error()); $row_rsCustomer = mysql_fetch_assoc($rsCustomer); mysql_select_db($database_cfs, $cfs); $query_rsCount = sprintf("SELECT COUNT(*) FROM cfsCustomers, cfsCustomersImages WHERE cfsCustomers.custID = cfsCustomersImages.custID AND custEmail = %s AND imageWANT = 'Y'", GetSQLValueString($colname_rsCustomer, "text")); $rsCount = mysql_query($query_rsCount, $cfs) or die(mysql_error()); $row_rsCount = mysql_fetch_assoc($rsCount); $totalRows_rsCount = mysql_num_rows($rsCount); and echoing out the results <?php echo $row_rsCount['imageWant']; ?> basically i was trying to get the results based on the logged in user
-
i have a table (cfsCustomersImages) containing the columns imagesID image custID imageWant the value of column imageWant is default "N" if the user wants and image they have a form they can check to change the value to "Y" what i need to show is a value of the total of "Y" values in the column for example if 6 "Y"'s are in the columns 6 images have been selected does this make sense?