
tjverge
Members-
Posts
118 -
Joined
-
Last visited
Everything posted by tjverge
-
SELECT sum('chiralstuctors') FROM `pi` WHERE `pilot` = 'Test' AND `pidate` BETWEEN '2011-01-02' AND '2011-07-02' Results:0 But in my table I have:3000 under column chiralstuctors
-
date
-
changed, still same result I tried with both 2011-1-2 and 2011-01-02
-
thanks for the idea but it still came back NULL
-
Hi, I have a SQL Query of SELECT sum('chiralstuctors') FROM `pi` WHERE `pilot` = 'Test' AND 'pidate' BETWEEN '2011-2-1' AND '2011-2-7' it should return 3000 but it keeps coming back Null, any ideas how to get the right data to return?
-
Problem solved I added a new function to the JavaScript file and it works now thank you all
-
I tried that I get "undefined" instead of a date
-
I may have an idea what the problem is the entered date format is DDMMYYYY, where as the mysql format is YYYYMMDD, I'm not sure how to convert it to match.
-
well besides the Array ( [start] => 1-2-2011 [end] => 5-2-2011 [submit] => Look Up ) there are no records showing up, there are records that would match in the database table
-
Ok got rid of the error but back to my first problem noting is showing up on the page <head> <script language="javascript" type="text/javascript" src="datetimepicker.js"> </script> </head> <form action="main.php?id=test.php" method="post"> <p>Start Date: <input name="start" id="start" type="text" size="10"> <a href="javascript:NewCal('start','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> End Date: <input name="end" id="end" type="text" size="10"> <a href="javascript:NewCal('end','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> <input name="submit" type="submit" value="Look Up"> </form> <?php if(isset($_POST['submit'])) { echo '<pre>'; // <----- ADD print_r($_POST); // <----- ADD echo '</pre>'; // <----- ADD $start = $_POST['start']; $end = $_POST['end']; $sql = "SELECT * FROM `corps` WHERE `notedate` BETWEEN '$start' AND '$end'"; $results = mysql_query($sql) OR DIE(mysql_error()); $numrow = mysql_num_rows($results) ; $i = 0; While ($i < $numrow) { $shownotes = mysql_result($results,$i,"notes"); echo $shownotes."<br>"; $i++; } } ?>
-
Line 29 is: $shownotes = mysql_result($results,$i,'notes');
-
Array ( [start] => 1-2-2011 [end] => 5-2-2011 [submit] => Look Up ) Fatal error: Maximum execution time of 30 seconds exceeded in /home5/ccccomma/public_html/test.php on line 29
-
<head> <script language="javascript" type="text/javascript" src="datetimepicker.js"> </script> </head> <form action="main.php?id=test.php" method="post"> <p>Start Date: <input name="start" id="start" type="text" size="10"> <a href="javascript:NewCal('start','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> End Date: <input name="end" id="end" type="text" size="10"> <a href="javascript:NewCal('end','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> <input name="submit" type="submit" value="Look Up"> </form> <?php if(isset($_POST['submit'])) { $start = $_POST['start']; $end = $_POST['end']; $sql = "SELECT * FROM `corps` WHERE `notedate` BETWEEN '$start' AND '$end'"; $results = mysql_query($sql) OR DIE(mysql_error()); $numrow = mysql_num_rows($results) ; $i = 0; While ($i < $numrow) $shownotes = mysql_result($results,$i,'notes'); echo $shownotes."<br>"; { Echo "Records found ".$i."<br>"; $i++; } } The $start, and $end don't seem to be getting any values
-
It's fixed was a spelling error in my table name had Corps should of been corps Thank you everyone for there help, and putting up with my questions
-
Still didn't work here is what I have: $query ="INSERT INTO Corps (`id`, `name`, `ticker`, `alliance`, `ceo`, `tax`, `members`, `hq`, `apidate`, `notes`, `notedate`, `updatedby`) VALUES ('', '$cnamedb', '', '', '', '', '', '', '', '$notes', NOW(), '$username')";
-
Sorry I don't see it they all look like they have a matching open and close... could you please post the right code? Thank you
-
updated to this so I could see the error: <?php $notes = $_POST['notes']; $cnamedb = $_POST['cname']; $username = $_SESSION['username']; $query ="INSERT INTO `ccccomma_eve`.`corps` (`id`, `name`, `ticker`, `alliance`, `ceo`, `tax`, `members`, `hq`, `apidate`, `notes`, `notedate`, `updatedby`) VALUES ('', '$cnamedb', '', '', '', '', '', '', '', '$notes', NOW(), '$username'"; mysql_query($query) or die('mysql error ' . mysql_error() . ' in query : ' . $query); echo $cnamedb." Updated"; ?> this is the out put: mysql error 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 '' at line 1 in query : INSERT INTO `ccccomma_eve`.`corps` (`id`, `name`, `ticker`, `alliance`, `ceo`, `tax`, `members`, `hq`, `apidate`, `notes`, `notedate`, `updatedby`) VALUES ('', 'The Choireporation', '', '', '', '', '', '', '', 'test', NOW(), 'TX1'
-
the below code as I understand should insert a new record into my database, but it's not. <?php $notes = $_POST['notes']; $cnamedb = $_POST['cname']; $username = $_SESSION['username']; mysql_query("INSERT INTO `ccccomma_eve`.`corps` (`id`, `name`, `ticker`, `alliance`, `ceo`, `tax`, `members`, `hq`, `apidate`, `notes`, `notedate`, `updatedby`) VALUES ('', '$cnamedb', '', '', '', '', '', '', '', '$notes', NOW(), '$username'"); echo $cnamedb." Updated"; ?> Any ideas why?
-
Thanks it fixed it
-
<form action="main.php?id=test.php" method="post"> <input name="name" type="text" /> <input name="submit" type="submit" value="Look Up" /> </form> <?php if(isset($_POST['submit'])) { $today = date("Y-m-d"); $pname = rawurlencode($_POST['name']); $xml_feed_url = 'http://api.eve-online.com/eve/CharacterID.xml.aspx?names='.$pname.''; The above works perfect until the user enters a character like ' to the box, how do I get it to pass the ' into the address? Thank you
-
updated code to $charid = $xmlr->result->rowset->row['characterID']; solved problem
-
not sure if it helps but when I use print_r($xmlr); it returns SimpleXMLElement Object ( [@attributes] => Array ( [version] => 2 ) [currentTime] => 2011-02-01 05:57:30 [result] => SimpleXMLElement Object ( [rowset] => SimpleXMLElement Object ( [@attributes] => Array ( [name] => characters [key] => characterID [columns] => name,characterID ) [row] => SimpleXMLElement Object ( [@attributes] => Array ( [name] => TX1 [characterID] => 1743425391 ) ) ) ) [cachedUntil] => 2011-03-01 05:57:30 )
-
The following code should output 1743425391, but it does not show anything <?php $xml_feed_url = 'http://api.eve-online.com/eve/CharacterID.xml.aspx?names=TX1'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $xml_feed_url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $xml = curl_exec($ch); curl_close($ch); $xmlr = new SimpleXMLElement($xml); $charid = $xmlr->result->characterID; echo $charid; ?> The xml is: <eveapi version="2"> <currentTime>2011-02-01 05:22:38</currentTime> − <result> − <rowset name="characters" key="characterID" columns="name,characterID"> <row name="TX1" characterID="1743425391"/> </rowset> </result> <cachedUntil>2011-03-01 05:22:38</cachedUntil> </eveapi> Any ideas where I went wrong?
-
Found the problem, if anyone else is having this problem I needed to switch $result = mysql_query("SELECT * FROM systems WHERE $type2 LIKE '%$name1%' ORDER BY Security DESC LIMIT $skip, $records_per_page") or die(mysql_error()); to $result = mysql_query("SELECT * FROM 'systems' WHERE '$type2' LIKE '%$name1%' ORDER BY Security DESC LIMIT $skip, $records_per_page") or die(mysql_error());
-
<?php ob_start(); session_start(); $pagerank=2; if ($rank < $pagerank){ header('Location:main.php?id=lowrank.php'); } else{ $name1 = $_GET["name"]; $type2 = $_GET['type']; Echo "Your seach for ".$name1." gave the following results: "; $records_per_page = 15; $total = mysql_result(mysql_query("SELECT COUNT(*) FROM systems WHERE '$type2' LIKE '%$name1%'"), 0) or die(mysql_error()); $page_count = ceil($total / $records_per_page); Echo $total." Records Found"; echo "<table border=0>"; $page = 1; if (isset($_GET['page']) && $_GET['page'] >= 1 && $_GET['page'] <= $page_count) { $page = (int)$_GET['page']; } $skip = ($page - 1) * $records_per_page; $result = mysql_query("SELECT * FROM systems WHERE $type2 LIKE '%$name1%' ORDER BY Security DESC LIMIT $skip, $records_per_page") or die(mysql_error()); echo "<table border=1>"; echo "<td>System Name</td><td>Security</td><td>Class</td>"; while ($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td valign =top>".$row['System Name']."</td>"; echo "<td valign =top>".round($row['Security'],1)."</td>"; echo "<td valign =top>".$row['System Type']."</td>"; echo "</tr>"; } echo "</table>"; echo "<br>"; for ($i = 1; $i <= $page_count; ++$i) { echo '<a href="main.php?id=' . $_GET['id'] .'&name='.$name1.'&type='.$type1. '&page=' . $i . '">' . $i . '</a> '; } } ?> The above code takes data entered in a form and is suppose to show the matching results, but no records are showing, it works when I replace the $name1 and $type2 with the actual values, any ideas?