
cunoodle2
Members-
Posts
602 -
Joined
-
Last visited
Never
Everything posted by cunoodle2
-
Couldn't you just use 1 table called equipment and have a field called "status" In that field would either be "checked_in" or "checked_out" ?? If not I don't see the reason to have 2 separate databases. 2 tables would do you just fine. If you are looking at having some form of history on these check ins/outs then I would suggest a transaction table where you log each time a piece of equipment was in/out and whom touched it. IF you insists on using 2 database then I would query both databases and store results in separate arrays. Then use array intersect to see where they overlap to then get the desired result set you are looking for. This by the way NOT something that I would recommend at all as it is using massive amounts of excess memory and widely inefficient. Either of the first 2 mentioned suggestions that I have would be much much more desirable.
-
Bigger Query Instead of Using arrays, and Pagination Help
cunoodle2 replied to imperium2335's topic in PHP Coding Help
The fact that the OP has posted 3 times with no responses in the past 25 hours makes me move on to the next thread........... -
I too get the same "Fatal error: Only variables can be passed by reference in /home/webfreak/public_html/plugins/deliveryAdRender/oxMarketDelivery/oxMarketDelivery.delivery.php on line 71" See my attached screen shot [attachment deleted by admin]
-
AyKay is correct. I also see an issue where you are setting a variable.... $title = $row['title']; And then just echoing it later. <?php echo $title; ?> Unless you are modifying the variable for some reason you are just bring up memory. To be more efficient just REMOVE this line.. $title = $row['title']; And in your echo statement just do this.. <?php echo $row['title']; ?>
-
I would think so. Was there a reason why you did NOT think using exit would be a good idea?
-
How to make php files download rather than execute?
cunoodle2 replied to andre1990's topic in PHP Coding Help
Can you re-name the files ".php.txt" and then just tell the user they need to rename them upon download? That or zip them up? If the file has a .php extension your server will treat them that way and execute them as apposed to allowing the actual file to be downloaded. I'd also suggest trying to get the user's email address and simply emailing the file (as an attachment) to the user. This would allow the actual .php file to be mailed out and also allow you to capture user data. -
User form failing miserably...Involves Basic Math
cunoodle2 replied to idontknowphp's topic in PHP Coding Help
I'm not going to download any attachments. Please place your code (and just the area that you think is in issue) in the BODY of the message (NOT as attachments). I'll take a look and let you know what the issue is. -
What does not show up at webhosting? Nothing at all? IS there an error messages? Is the HTML displayed at your localhost or at your web host? Is the directory structure the same at both places and are you sure you have all of the exact same files in all of the exact same places at your web host as you do at your local host?
-
You can use this example that I just wrote for a buddy of mine. It has a number of different date layouts. .. <?php $dow = (date('w') + 6) % 7; $monday = strtotime("-$dow days"); echo "<b>Monday of this week is dated:</b> "; echo date (' D jS M Y', $monday); // Mon 29th Aug 2011 echo "<br />\n"; echo "<b>Monday of last week is:</b> "; $startTime = mktime(0, 0, 0, date('n'), date('j')-6, date('Y')) - ((date('N'))*3600*24); $endTime = mktime(23, 59, 59, date('n'), date('j'), date('Y')) - ((date('N'))*3600*24); echo date (' D jS M Y', $startTime)." - ".date (' D jS M Y', $endTime)."<br />\n"; echo "<b>Monday of 2 weeks ago is:</b> "; $startTime = mktime(0, 0, 0, date('n'), date('j')-13, date('Y')) - ((date('N'))*3600*24); $endTime = mktime(23, 59, 59, date('n'), date('j')-7, date('Y')) - ((date('N'))*3600*24); echo date (' D jS M Y', $startTime)." - ".date (' D jS M Y', $endTime)."<br />\n"; echo "<b>Monday of 3 weeks ago is:</b> "; $startTime = mktime(0, 0, 0, date('n'), date('j')-20, date('Y')) - ((date('N'))*3600*24); $endTime = mktime(23, 59, 59, date('n'), date('j')-14, date('Y')) - ((date('N'))*3600*24); echo date (' D jS M Y', $startTime)." - ".date (' D jS M Y', $endTime)."<br />\n"; echo "<b>Monday of 4 weeks ago is:</b> "; $startTime = mktime(0, 0, 0, date('n'), date('j')-27, date('Y')) - ((date('N'))*3600*24); $endTime = mktime(23, 59, 59, date('n'), date('j')-21, date('Y')) - ((date('N'))*3600*24); echo date (' D jS M Y', $startTime)." - ".date (' D jS M Y', $endTime)."<br /><br />\n"; ?>
-
I may have botched that a little on the post. Here is the link to the page that I got that info from.. http://php.net/manual/en/pdostatement.rowcount.php
-
Technically your query will NOT return NULL. It will return zero results. From the Manual: Counting rows returned by a SELECT statement For most databases, PDOStatement::rowCount() does not return the number of rows affected by a SELECT statement. Instead, use PDO::query() to issue a SELECT COUNT(*) statement with the same predicates as your intended SELECT statement, then use PDOStatement::fetchColumn() to retrieve the number of rows that will be returned. Your application can then perform the correct action. <?php $sql = "SELECT download_hits as total_hits from date1_dcerpc where time = 1314712800"; if ($res = $conn->query($sql)) { /* Check the number of rows that match the SELECT statement */ if ($res->fetchColumn() > 0) { /* Issue the real SELECT statement and work with the results */ $sql = "SELECT download_hits as total_hits from date1_dcerpc where time = 1314712800"; foreach ($conn->query($sql) as $row) { print "Name: " . $row['download_hits'] . "\n"; } } /* No rows matched -- do something else */ else { print "No rows matched the query."; } } $res = null; $conn = null; ?>
-
The ONLY reason you should ever have 2 DBs would be for data backups. There should never be a reason to have 2 sets of data. It will just cause issues.
-
Can you show your code?
-
Can you see if it is NULL??? Try a var_dump() on the values as likely it is an array
-
I'd like my INSERT/UPDATE to show real time results on a Page...
cunoodle2 replied to Jim R's topic in PHP Coding Help
I went to that google page and searched for.. using ajax to do live updates to a mysql One of the best results was this one.. http://www.9lessons.info/2009/11/insert-delete-with-jquery-and-ajax.html Give it a try.. post some code and let us know what you come up with. -
go to google and just search for.. how to execute a php script every 5 minutes via cron job There are a ton of examples
-
Can you create a new file called "unset_variables.php" In there unset each variable you think you are ever using. Then (now and in the future) if you ever want to unset everything you can just do.. require_once unset_variables.php That work?
-
Post your updated code and we will go from there.
-
I'd try the second result here.. http://tinyurl.com/3ct9923
-
if you want to know the number of results you have to use "count" like this.. $result_rows = mysql_query("SELECT count(*) FROM events WHERE category = 'adults' ORDER BY 'date'"); If that is not what you are looking for then you will have to give me more info. Your post is vague as you don't tell us if there are any error messages or exactly what the issue is.
-
ALSO these two items should ONLY be called AFTER you have determined that the form has been submitted.. $dob = $_POST['dob']; //THE SEARCH FUNCTION $result = mysql_query ( "SELECT * FROM users WHERE dob LIKE '%$dob%' ");
-
Well I see 2 issues with this code in particular.. <?php while ($row = mysql_fetch_assoc($result)) { $message = $row["dob"]; } ?> 1) you simply keep overwriting the variable "$message." So if you in theory had 50 results then the only item stored would be the LAST one 2) you NEVER echo any php item to the screen. Where do you expect to see this item??
-
Developing classifieds website using PHP
cunoodle2 replied to kks_krishna's topic in PHP Coding Help
Yes, php is a fantastic language to do that. I would suggest going with an already existing classified ads open source platform and then modifying accordingly. You can see a few suggestions here.. http://www.opensourcescripts.com/dir/php/classified-ad-managers.html -
Pikachu2000 already gave you the answer. I'll go even further and just paste the line where the error is.. elseif (czywypelnione($ulica) && (isset($_POST['Rejestruj']))) { $mesage='Wype³nij Wszystkie dane