Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. ahh, that's because the date range isn't being applied to the migrate count() - that's everyone in the table. just append the WHERE within the brackets to include your daterange condition aswell
  2. your else is actualy within / after it's own opening brace...
  3. if your new to PHP you should probably start at the beginning. I believe the function you are thinkng about using has been depreciated.
  4. it is suggested that you remove the where clause and include the conditional lookup within the join, yet you say that "adding" it to the where clause would return "all records". That makes no sense. if you added that SQL to your where clause you would get nothing but errors. On top of that, how does adding conditions to a where clause cause all records to be returned (with the obvious exception of a stupid OR stuck in for a giggle)? Your reply is nonsensical from start to finnish, so in answer - all of it.
  5. try changing count(employees) to count(*) what exactly is a Wierd number?
  6. put the UUID into the session variable - $_SESSION['uuid'] = $uuid; then you can call it from the associated pages by adressing the $_SESSION['uuid'] = $newVariableName, as long as every page visited (including the paypal one) has session_start(); at the top of it the session will remain open, failing that you're gonna want to have some cookies.
  7. This should do the job: <?php $alphabet = array('#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); foreach ($alphabet as $letter) { echo "<a href=\"?letter=" . $letter . "\">" . $letter . "</a> ¦ ";} ?><?php require("db.php"); $letter=$_GET['letter']; //if(isset($letter)){ if (chr($letter) >= '1' && chr($letter) <= '9' ){ $where = " WHERE LEFT(title, 1, 1) BETWEEN 0 AND 9"; } else{ $where = " WHERE LEFT(UPPER(title), 1, 1) = UPPER('$letter')"; } $query = "SELECT COUNT(*) as num FROM games $where"; $total_pages = mysql_fetch_array(mysql_query($query)); include("pagination.php"); $sql = "SELECT * FROM games WHERE title LIKE '$letter%' LIMIT $start, $limit"; $result = mysql_query($sql); while($rows=mysql_fetch_array($result)) { echo '<tr><td>'.$rows['title'].'<br></td></tr>'; } // } ?> </table> <?php echo $pagination; ?>
  8. because you are only telling it to deserialise $fields[$key]['f_names](value list), the field that is remaining serialised is $fields[$key]['1'](value list). add another foreach to handle that and you should be rockin'
  9. run a page with <?php phpinfo(); ?> on it and check what the HTTP_ACCEPT_CHARSET value is for the server envyronment.
  10. you could try and use a series of explode()'s on your string...but it would probably be better to address why you have a string in that format in the first place .
  11. use chr() = chr+$noOfTurns in place of the hard set translate array. you will need to itterate it through the lenth of the $string input using substr.
  12. I was trying to work out a way to run the reverse tree lookup with only one query, I got code that havs managed to break out each distinct level of the tree, but can't get my head around how to have them recursivly relate to level above with a direct refference. It's going to take someoone who is much better at contitional array mannipulation than I am to sort that (fotunately, there are many of them on this forum so hope is not lost).
  13. if you send information between pages using method="POST" then you are not using the url, it is sent directly from the HTML form to the $_POST[] global variable. If you are using information from the url to populate variables then you need to use method="GET". $_GET[] 'gets' the variables from the url as the page is loaded.
  14. Post doesn't get variable info from the URL, it is sent from the form directly to the POST superglobal. What way do you want to do things? using POST form variables or or using GET URL variables?
  15. I'm trying to see if I can work out a way of manipulating some arrays to fix it so only one query need be run for the folder contents, as for the mysql_close() it's not what you think. It doesnt terminate a query, it closes the current connection to the database. so long as you check for an existing connection and create one if it's not there before each query / function you'll be fine.
  16. good info, but for the fact the the OP alreadt stated they wrote the code themselves following video tutorials...
  17. You should be running mysql_close at the end of every query, not at the end of the script. I can't endorse looping select queries, it's really bad practice. There may be a way arround it using some complex PHP, I'll need to have a think on it.
  18. that will do it. I just thought of another one: foreach ($idnumber as $ref => $ID) { mysql_query("UPDATE slidorion SET Name = '{$Name['$ref']}' WHERE ID = '$ID'"); mysql_query("UPDATE slidorion SET Description = '{$Description['$ref']}' WHERE ID = '$ID'"); mysql_query("UPDATE slidorion SET Date = '{$Date['$ref']}' WHERE ID = '$ID'"); } Don't know why I didn't think of that sooner...though it has been a long bloody week :/ Glad you got it working anyway!
  19. rename your index.html page to index.php, add the <form>...</form> code to the div where you want it and, assuming the code is designed for same page loading, copy it into the page (making sure to bring the <?php and ?> tags with you, and you should be good to go.
  20. mysql_free_result() makes absoloutly no difference on the sheer volume of queries themselves. To get the number of albums within an album you would use a recusive count query running through from the current location and tracing through the parent tree. One level down isn't so bad, but tracing the tree to the verry end of each branch is, I think, virtualy impossible with your table structure.
  21. $id_list = implode(", ", $ID); Don't think that's going to help, but there you have it. I think were going to need to dynamicly generate the SQL on the fly. But if that works for you let me know.
  22. How are you connecting to the server and what does your app use to connect to the database? Has there been any windows updates installed arround that time (event loggs should tell you)
  23. That's the standard way of doing it. just remember to execute each query before you overwrite the $sql variable with the next one.
  24. Assuming everything else is on the server, I think the script would still fail as the process is controlled by the HTTP session connection to the host. If you were running it on the servers console it would go on regardless, but if the controlling process (your web session) terminates, I am 99% sure it will terminate the PHP scripting within it (been around computers so long I'm never 100% about anything any more!).
  25. What you want to do is use the value within the array stored at the key of ID, so this should work: mysql_query("UPDATE slidorion SET Name = '{$Name['$ID']}' WHERE ID = '$ID'"); This will only work if $ID is NOT an array aswell...
×
×
  • 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.