Jump to content

Pikachu2000

Staff Alumni
  • Posts

    11,377
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Pikachu2000

  1. Then my guess is that one or more of the queries is failing (or simply not producing any results). You have no error checking for your query execution, and you can't even echo the query strings to see if they have the values they should have until you separate the strings from the executions. $query = "SELECT whatever FROM table"; $result = mysql_query( $query ) or die( '<br />Query string: ' . $query . '<br />Produced error: ' . mysql_error() . '<br />' ;
  2. None of that code actually displays anything. You need to find the code that displays the part that's too long, and use the substr() function there.
  3. ini_set('display_errors', 'On');
  4. There isn't enough of the code posted to know for sure, but I'd try it here to start with: $stationinfo = ' '.$currentsong.' ' . substr($song, 40) . ' '; and see if that works.
  5. This is why Pikachu: Yes, I saw that and fully understood it as well. However, without asking a few qualifying questions it wasn't clear whether there would be a better or more efficient way to handle the proposed task. As it stands, I'm still not convinced that this is the best way, however it now at least makes sense as to WHY the OP wants to employ this method.
  6. Look at the manual for substr($song, 40); and adjust it to the appropriate length.
  7. The divs don't have the same names as the elements in the CSS . . . outercontent vs. outercenter, content vs. center . . .
  8. I would think it's the path in the <link> tag. If you try it temporarily as an include() with that path, you'll know if it's right of not.
  9. Can't diagnose the illness without seeing the patient. Post the relevant code . . .
  10. Can I just ask why you wouldn't just use one database and have all the forms from the different websites insert the record to it? Seems like it would be substantially less work than sending emails to another script to parse them and insert the records.
  11. I'd venture a guess that the stylesheet isn't getting included, but without the urls or code, it's hard to say.
  12. There's a typo in this line if(mysql_num_rows($results)==0) $results should be $result, which makes me wonder what is going on. That should always evaluate to TRUE with that typo, and produce the "No results returned" error. But it doesn't seem to be doing that, unless you've already corrected it . . .
  13. Instead of acting like such an ass when someone who is trying to help you FOR FREE makes a perfectly valid suggestion, and even provides the reasons that the suggested method would be better, you should at least take the time to read the manual before spouting off when you don't know what you're talking about. You should get really familiar with Google, because you're unlikely to find people here who will be willing to help someone who behaves like you.
  14. Copy your query into phpMyAdmin, run it and see what, if any, results are returned.
  15. That's the default ORDER from MySQL; it tries to sort the numbers pseudo-alphabetically. Try this instead, and see what you get $query = "SELECT `User`, `XP` FROM `Game` ORDER BY CAST(`XP` AS SIGNED INTEGER) DESC";
  16. Yeah, that makes sense. Make sure that the URL has the variable specified in it: http://whatever/content.php?sel_subj=some_value and echo the value of $sel_subj before the function is called. I suspect it has no value, causing the query string to be "SELECT * FROM pages WHERE subject_id = ORDER BY position ASC";
  17. Which function call is producing the error, how are you calling it, and have you made sure any parameters passed to the function have proper values?
  18. That's kind of what I thought was happening. ORDER BY orders the results based on the contents of a field, therefore you have to specify a field name. $query = "SELECT XP FROM Game ORDER BY XP";
  19. nl2br() is what you need, and see comments within code. <?php $query = "SELECT * FROM ticket_replies WHERE tid='$tid' AND uid='$uid'"; // Separate the query string from the execution, makes debugging easier $ticketslist2 = mysql_query( $query ); // use the value of the $query var in the execution. while ($row = mysql_fetch_array($ticketslist2)) { $id2 = $row['id']; $who2 = $row['who']; $message2 = nl2br($row['message']); // nl2br() function converts newlines to <br /> tags. $subject2 = $row['subject']; $date2 = $row['date']; // Protect against SQL injections ***************** ENTIRELY unnecessary when displaying data, imperative when INSERTING string-type data //$id = mysql_real_escape_string($id2); //$who = mysql_real_escape_string($who2); //$subject = mysql_real_escape_string($subject2); //$message = mysql_real_escape_string($message2); //$date = mysql_real_escape_string($date2); echo "Replied by <b>$who</b> on <b>$date</b><br /> <b>Message:</b>$message<br /><br /><hr>"; } ?>
  20. SUM(`quantity`), perhaps?
  21. Checkboxes are only in the $_POST array if they're checked. You can either use a radio button, or check for the absence of the checkbox value, and base your query on the results of that.
  22. See my edit above regarding register_globals. None of the variables will have values unless a) register_globals = On (wrong way) - OR - b) they are assigned values based on the values in the $_POST array (right way).
  23. Initially, you have an extra closing curly brace, but what is this code supposed to do? Echo the result of $numa divided by $numb divided by $num2, or just echo their values separated by slashes? EDIT: It also appears to rely on register_globals = On, which it shouldn't be, so you need to assign integer values to the variables via $numa = (int) $_POST['numa'];, etc. if($submit) { echo $numa / $numb / $numb2; { // get rid of this one. } else { ?>
×
×
  • 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.