Jump to content

cb154

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by cb154

  1. ok i know I am replying to my own thread but looking through the archives everyone is saying use the schedule task. no problem I have now written a php page to create the jobs in schedule task via the AT command. however I want to create the task as the windows logged in user not the NT/ADMINISTRATOR that the schedule task seems to adopt. I cannot see a /option for user in the AT function.
  2. Hi, This may be the wrong way to do things but I am fairly new to this. I have a mysql database which I store some jobs I run. I usually use schedule tasks for this but was wondering if I could do this more efficiently in PHP. I have a table with days of the week comma seperated and then a column with a time and then a column with the name of the job. I basically need something to kick off a job at a given time on a certain day. If someone can point me in the right direction it would be appreciated and I can usually crack on from there
  3. indeed I need to perform check for each radio button in the group. sometimes I just need a nudge
  4. I have a group of 4 radio buttons. my mysql database knows which one the user selected previously when they stored some information. I now wish to display the same buttons but have radio button checked that the user chose before. I know this can be done but having one of those mind melt moments where I cannot think of the solution so I have 4 buttons that look like this <input type="radio" name="clarity" id="clarity" value="Opaque"> Opaque<br> <input type="radio" name="clarity" id="clarity" value="Deep"> Deep<br> <input type="radio" name="clarity" id="clarity" value="Mid"> Mid<br> <input type="radio" name="clarity" id="clarity" value="Pale"> Pale<br></td> I just need to attached a checked field to the correct item
  5. Hi, I have a small piece of code that creates an RSS feed using a mysql database. The issue is the page itself is blank however if I right click and view source I can see all the feed there. I convert the dat time field into a standard RSS date field. The web address is http://vinovote.com/news/feed.php My code is as follows <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> <rss version="2.0"> <channel> <title>Vinovote.com</title> <description>The Latest News And Views From Around The Web</description> <link>http://www.vinovote.com/</link> <copyright>Your copyright information</copyright> <?php require_once('../Connections/connection.php'); mysql_select_db($database_vinovotedb, $vinovotedb); $doGet = mysql_query("SELECT feed_content.feed_content_id, feed_content.feed_id, feed_content.url, feed_content.title, feed_content.content, feed_content.item_time, Date_FORMAT(feed_content.item_time,'%a, %d %b %Y %T') AS pubDate FROM feed_content order by item_time desc LIMIT 50 ", $vinovotedb) or die(mysql_error()); while($result = mysql_fetch_array($doGet)){ ?> <item> <title> <?php echo $result['title']; ?></title> <description> <?php echo $result['content'];?></description> <link><?php echo $result['url'];?></link> <pubDate> <?php echo $result['pubDate']; ?></pubDate> </item> <?php } ?> </channel> </rss>
  6. that makes sense. was just me over complicating things
  7. would a UNION query not suffice then. if we break down each part into 2 seperate queries ie. what you need from table 1 and table 2 then union them up ?
  8. hate to say it and I might be way off can you not just do Select Distinct instead then ?
  9. ok so simply I have 4 users with id 1 - 4 all have category 16. I also have them all attending an event (id 1). I get 16 returned rows (4 users all attending the event hence the 16) do you just want 1 row and number of attendees ?
  10. probably a type but none of the tables have category_id in them ?
  11. could you post the table structure. I will then try and replicate and fix.
  12. Hi, I have written a search engine for my site which is Wine related. no the question is around using full text searches. User types in a certain wine say Chateau x de b and it returns that at the top as I order by ranking however it also returns all the wines in my db that have Chateau in them as you can imagine that is pretty much all of them. I also want to stop people typing just Chateau in the search box as they will also slow it down. Is there a way of matching against a seperate list of keywords to ignore ?
  13. have a feeling this might end up with me writing my own !
  14. I am assuming there is a class I need to include in order to access the Normalizer ? Sorry never come across this function so unsure how I utilise it ? I f i just have the code Normalizer::normalize ( string $input [, string $form = Normalizer::FORM_C ] ) I get unknown class Normalizer
  15. many thanks. been struggling to find a solution to this !!
  16. Hi wasn't sure if to post here or html or mysql help but got to start somewhere. I have a table with some words contain the french acute I also have another table with words in normal UK english so for example 1 table will have Château Haut-Bages-Libéral but the other table will have Chateau Haut Bages Liberal. I am trying to perform a query from one to the other however and quite rightly it fails. is there a way of normailising the french type to enable the query to work ?
  17. also if i do it via your method it still does not work
  18. The error I am getting is that is is not performing the insert, the include file contains a form which one filled in and submitted will redirect the user. I see, thought you were doing something like this: if($something==$somethinelse) { include("something.php"); } You method should work, is it doing it just for that one include only? whats the include look like something like this? include($include); or include("$include"); let's take a peek at that, but if it's only doing it for one of the files... hmmm. just include ($include); is what I am doing. it is just this include that doesn't work when performed in this way.
  19. <?php require_once('../Connections/vinovotedb.php'); ?> <?php session_start(); if (isset($_GET['WineID'])) { $wineID = (get_magic_quotes_gpc()) ? $_GET['WineID'] : addslashes($_GET['WineID']); } else { if (isset($_POST['wineID'])) { $wineID = (get_magic_quotes_gpc()) ? $_POST['wineID'] : addslashes($_POST['wineID']); } } // lets get the year if (isset($_GET['Year'])) { $year = $_GET['Year']; } if (isset($Year)) { $year = $Year; } // setup all the variables needed. if (isset($_POST['WineID'])) { $id = $_POST['WineID']; } else { $id = $wineid; } $dateday = date("d"); $datemonth = date("m"); $dateyear = date("Y"); $vintage = $_POST['bottleVintage']; $usid = $_SESSION['MM_Username']; $quantity = $_POST['quantity']; $dateacquired = $_POST['day'].$_POST['month'].$_POST['year']; $price = $_POST['price']; $currency = $_POST['currencyCode']; $totalcost = $price; $winesize = $_POST['bottleSize']."ml"; $location = $_POST['storingInfo']; if (isset($_POST['wineryIsOtherParty'])){ } else { $purchase = $_POST['otherPartyName']; } if (isset($_POST['isOnOrder'])){ } else { } $alcohol = $_POST['alcohol']; $description = $_POST['description']; $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "CellarEntry")) { while($counter<$quantity) { $insertSQL = "INSERT INTO cellar (WineID, UserID,WineYear,Quantity,DateAcquired,Price,TotalCost,Currency,WherePurchased,LocationStored,Alcohol,Description,WineSize) values ('".$id."','".$usid."','".$vintage."','1','".$dateacquired."','".$price."','".$totalcost."','".$currency."','".$purchase."','".$location."','".$alcohol."','".$description."','".$winesize."')"; mysql_select_db($database_vinovotedb, $vinovotedb); $Result1 = mysql_query($insertSQL, $vinovotedb) or die(mysql_error()); $counter++; } printf("<script>location.href='mycellar.php'</script>"); } echo $quantity; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form action="<?php echo $editFormAction; ?>" method="POST" name="CellarEntry" target="_self" id="CellarEntry"> <tr><td colspan="4" class="titlepaddingbottom"></td> </tr> <tr> <td class="smallfieldlabel"> <table width="686" border="0"> <tr> <td width="141">Date:</td> <td width="291"> <input name="year" maxlength="4" size="4" value=<?php echo $dateyear ?> type="text"> / <input name="month" maxlength="2" size="2" value=<?php echo $datemonth ?> type="text"> / <input name="day" maxlength="2" size="2" value=<?php echo $dateday ?> type="text"></td> <td width="240"> </td> </tr> <tr> <td>Vintage:<span class="smallfieldvalue"> </span></td> <td><span class="smallfieldvalue"> <input name="bottleVintage" maxlength="10" size="6" value=<?php echo $year; ?> type="text"> </span></td> <td> </td> </tr> <tr> <td>Bottle Size </td> <td><span class="smallfieldvalue"> <input name="bottleSize" maxlength="10" size="6" value="750" type="text"> </span></td> <td> </td> </tr> <tr> <td>Quantity: </td> <td><input name="quantity" maxlength="20" size="10" value="1" type="text"></td> <td> </td> </tr> <tr> <td> Price</td> <td><span class="smallfieldvalue"> <input name="price" maxlength="20" size="10" value="0" type="text"> <select name="currencyCode"> <option value="CAD">CAD</option> <option value="ARS">ARS</option> <option value="AUD">AUD</option> <option value="BRL">BRL</option> <option value="CHF">CHF</option> <option value="CLP">CLP</option> <option value="EUR">EUR</option> <option value="GBP" selected>GBP</option> <option value="HKD">HKD</option> <option value="ILS">ILS</option> <option value="NZD">NZD</option> <option value="TRY">TRY</option> <option value="USD">USD</option> </select> each </span></td> <td> </td> </tr> <tr> <td>From</td> <td><span class="smallfieldvalue"> <input name="wineryIsOtherParty" value="on" type="checkbox"> Winery</span></td> <td><span class="smallfieldvalue">or <input name="otherPartyName" maxlength="75" size="28" value="" type="text"> </span></td> </tr> <tr> <td>On Order </td> <td><span class="smallfieldvalue"> <input name="isOnOrder" value="on" type="checkbox"> (select this if this is a future order.) </span></td> <td>Stored: <input name="storingInfo" maxlength="75" size="40" value="" type="text"></td> </tr> <tr> <td>Alcohol %:<span class="smallfieldvalue"> </span></td> <td><span class="smallfieldvalue"> <input name="alcohol" maxlength="10" size="6" value="" type="text"> </span></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td>Description</td> <td colspan="2" rowspan="2"><textarea name="description" cols="45" rows="6"></textarea></td> </tr> <tr> <td> </td> </tr> </table> </td> </tr><tr><td class="smallfieldvalue"> </td> </tr> <tr> <td class="smallfieldlabel"> </td> </tr><tr><td class="smallfieldlabel" valign="top"> </td> <input type="hidden" name="WineID" value="<?php echo $wineID; ?> <td colspan="3"><BR> <input type="submit" id="search-submit" value="Save to Cellar" /> <input type="hidden" name="MM_insert" value="CellarEntry"> </form> </body> </html> this is the include file that is not working when included via a varable as opposed to a straight include 'myfile.php'
  20. The error I am getting is that is is not performing the insert, the include file contains a form which one filled in and submitted will redirect the user.
  21. so this is the assignment <?php // assign the include depending on the option. if (isset($_POST['add'])) { $include = 'acquisitioninfo.php'; } else if (isset($_POST['edit'])) { $include = 'editsearchresults.php'; } else if (isset($_POST['submit'])) { $include = 'editsearchresults.php'; } else{$include ='editsearchresults.php';} ?> nothing untoward going on in there that I can see. I will also post the code from the include file as that is where the failure is happening. but the oddity is that if i just do it as a straight include .. then it works it only fails when I include via a variable
  22. Hi I am having a real weird issue. I have a page that I want to do a conditional include in which is all working fine. However the included page ceases to work when included via a conditional variable for example if i do include 'myfile.php' all works fine if i assing myfile.php to $myfile then use include $myfile the included file stops working ? any thoughts.
  23. That is coming from a SOAP call and returning the details to me in an array which I am trying to then shred into the MYSql database.
  24. Hi, I am making a call and getting an array returned which appears like this Result stdClass Object ( [GetHistoricalCrossRatesRangeResult] => stdClass Object ( [Outcome] => Success [identity] => IP [Delay] => 0.016 [symbol] => USDEUR [From] => stdClass Object ( [symbol] => USD [Name] => United States Dollar ) [To] => stdClass Object ( [symbol] => EUR [Name] => Euro ) [CrossRates] => stdClass Object ( [CrossRateItem] => Array ( [0] => stdClass Object ( [Date] => 2/16/2010 [First] => 0.73539415207652 [Last] => 0.72663855924982 [High] => 0.73589741835227 [Low] => 0.72569994084434 I have written some code to put this into a mysql database but I am having some problems. The date is not being returned and the decimal numbers are being rounded. I am a newbie and my code looks like this $max = sizeof($result->GetHistoricalCrossRatesRangeResult->CrossRates->CrossRateItem); for ($i = 0; $i<=$max; $i++) { $Ccy = $result->GetHistoricalCrossRatesRangeResult->Symbol; $TSDate = $result->GetHistoricalCrossRatesRangeResult->CrossRates->CrossRateItem->$i->Date; $First = (double)$result->GetHistoricalCrossRatesRangeResult->CrossRates->CrossRateItem->$i->First; $Last = (double)$result->GetHistoricalCrossRatesRangeResult->CrossRates->CrossRateItem->$i->Last; $High = (double)$result->GetHistoricalCrossRatesRangeResult->CrossRates->CrossRateItem->$i->High; $Low = (double)$result->GetHistoricalCrossRatesRangeResult->CrossRates->CrossRateItem->$i->Low; $query = "Insert into FXRates (CCy, TSDate, First, Last, High, Low) values ('$Ccy', '$TSDate', $First, $Last, $High, $Low)"; mysql_query ($query) or die ("Query failed: " . mysql_error() . " Actual Query: " . $query); } when i check my query I am getting Insert into FXRates (CCy, TSDate, First, Last, High, Low) values ('USDEUR', '', 0, 0, 0, 0) can anyone point out my mistake please.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.