Jump to content

aebstract

Members
  • Posts

    1,105
  • Joined

  • Last visited

Posts posted by aebstract

  1. It's really looking like some sort of memory, run time, etc issue. I was doing okay, did a replace all on something completely different than what I was working on and it white paged as well. I know I did hit a memory issue once but it produced an error on the server's log and was fixed when I added

    php_value memory_limit 1000M
    

    to the .htaccess.

  2. Okay it's doing it when I make the change stated a few posts back to any location in the file similar to that. (so for each round and in each case, it doesn't matter where.. just seems to be a magic number of them that were able to change over until it stops) So, it would sound as if it was some sort of timing out or too big or something like that, though no errors produce saying such and it dies pretty quick versus how long it takes to load on a fresh load.

  3. I've got error reporting for all of my queries and nothing is showing up. I'm just getting a white page and the actual server isn't logged any problems either. It's just white. Remember, the only reference to an sql syntax problem was from command line. Also, the queries are working fine before I add that line so I don't see why it should throw them off.

     

    Okay, I just tried skipping 12 and doing 13, same white page.

     

    Now, I went back down to 12 where the page displays fine. I went up and added an echo "some dummy text"; but like 2 sentences long to cover the amount of characters just for tests sake and everything returned fine. I'm really lost right now.

  4. the following does not work

     

    $old = "*(#01)*";
    $new = "\";
    
    $message = str_replace($old, $new, $message);
    
    

     

    thanks

     

    Here is the logic of it:

     

    str_replace("replace this", "with this", "in this string");

     

    $message shouldn't be in your str_replace. I'm not sure what you're trying to do though.

  5. Okay I just kind of upset myself, I added the error reporting in at the top but I was back to that line. I had done like 40 other lines just needed to redo them before trying the error reporting now I can't :( Regardless, I put the one line back the way it should be and the page is white again, with the code you gave me at the top. Nothing is displayed. There is SQL but it isn't in anything that is being changed between the two trys. It's just after I do the change above it get white page.

  6. This is happening when I changed this line:

     

    } else { if ($r2[12] != 'x') { $content .= "<li class=\"score\" style=\"margin-top: 0px;\">"; if($r2rt[12] < '0') { $content .= "$r2[12] @ $r2s[12]</li>\n"; } else { $content .= "$r2rt[12] | $r2[12] @ $r2s[12]</li>\n"; } } else { $content .= "<li class=\"score\" style=\"margin-top: 0px;\"> </li>\n"; }}
    

     

    to this line:

     

    } else { if ($r2[12] != 'x') { $content .= "<li class=\"score\" style=\"margin-top: 0px;\">"; if($r2rt[12] < '0') { $content .= "<span style=\"color: red;\">$r2rt[12]</span> | $r2[12] @ $r2s[12]</li>\n"; } else { $content .= "$r2rt[12] | $r2[12] @ $r2s[12]</li>\n"; } } else { $content .= "<li class=\"score\" style=\"margin-top: 0px;\"> </li>\n"; }}
    

     

    Did this to the one previous to it, except the 12s were 11s and there is no problem, when I get to this one I have a problem. The host said something about SQL syntax, could any sort of mysql have a problem with this ^?

     

    Adding this to my .htaccess:

     

    php_flag display_errors on
    php_value error_reporting 7 

     

    Didn't display any error message, still white.

  7. I am not sure what is wrong. I've got a huge file, like 15k lines. Firstly, are there any limits to a php file size in line length, character amount, or file size? I'm getting a white page and the server isn't logging any errors. My host took it and ran it from command line and here is his response:

    I'm not sure at this point. If it exhausted the memory it would log it.

    Running it from the command line produces several notices and an error

    message regarding SQL syntax. Running it through Apache results in that

    process exiting with no message.

    Should I post the code here? Basically what I noticed was I had something I was replacing in textpad. There were probably a couple hundred of the line. I do this for like 50ish lines. I went and undid a bunch of it, since textpad stores a good bit of memory to backup to. Uploaded and it was fine. Went forward some and it whited. I did this until I eliminated it down to one line that when I did it, it caused the white page. Looking at the line there was absolutely nothing wrong with it at all. The replace is doing the exact same thing to the exact same line in each spot of the file, so only checking one location should be fine.

     

    Should I post the line that starts the error? The entire script? Does a white page without any errors mean anything?

     

  8. Yeah, I am sure that it is and it would have a few little quirks in it, but I've never done anything such as conditional statements inside of a query. I had a deadline of last Saturday but now I think I have until next Monday to figure it out.

  9. $myData = mysql_query("SELECT theID FROM myData WHERE myID = '$userID'");

    mysql_query("SELECT * FROM otherTable WHERE personID = '$myData'")

     

    So what I am trying to do is return the list of 'theID' from the table 'myData'. Then with the list of IDs, get all the related rows from 'otherTable'.

     

    You're wanting to grab your first result and join your other table based on the id equalling the personID. I think I got what you want right here, not sure if the table-data matches to what you're doing but hopefully  ;D

     

    $query = mysql_query("
    SELECT *
    FROM myData
    INNER JOIN otherTable ON myData.myID = personID.otherTable
    WHERE myID.myData = '$userID'
    ");

  10. Certainly will try to get you whatever will help.

     

    Firstly, here is a link to the section I'll be referring to:

    http://outlawracing.com/index.php?page=ladders&event=1

    If you scroll down you will see 4.70 Index, 5.30 Index, 6.00 Index and 7.00 Index

     

    The order that I'm getting right now is from the query I mentioned above, here it is again:

     

    $query = mysql_query("
    SELECT registrations.firstname, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.id, participants.cr
    FROM events
    INNER JOIN participants ON participants.eventid = $_GET[event]
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE events.id = $_GET[event] AND registrations.class = '$var'
    ORDER BY LEAST(q1, q2, q3)") or DIE(mysql_error());

     

     

    For example, I'll do the 4.70 class.

     

    Here is what it currently looks like off of the above query:

    Mike Herring  4.616 @ 151.46  4.669 @ 154.03  4.686 @ 153.23

    Blake Wilder  4.685 @ 151.34  5.161 @ 128.65  5.023 @ 109.83

    Scott Underwood  4.730 @ 149.18  4.706 @ 150.45  4.706 @ 150.45

    Kenny Acree  4.730 @ 148.85  4.730 @ 148.85  4.730 @ 148.85

    Isreal Deraney  4.794 @ 148.87  4.732 @ 149.13  4.732 @ 149.13

    Randy Alexander  4.822 @ 137.48  4.755 @ 148.20  4.755 @ 148.20

    Jeff Wilkerson  5.026 @ 116.73  4.902 @ 145.47  4.902 @ 145.47

    Jody Voyles  [/td]  4.973 @ 140.18  4.973 @ 140.18

    Jeremy Ellis  5.044 @ 133.8  5.044 @ 133.83  5.044 @ 133.83

    Mike Ghee    5.045 @ 137.79  5.045 @ 137.79

     

     

    It needs to be ordered like this:

    Scott Underwood  4.730 @ 149.18  4.706 @ 150.45  4.706 @ 150.45

    Kenny Acree  4.730 @ 148.85  4.730 @ 148.85  4.730 @ 148.85

    Isreal Deraney  4.794 @ 148.87  4.732 @ 149.13  4.732 @ 149.13

     

    Randy Alexander  4.822 @ 137.48  4.755 @ 148.20  4.755 @ 148.20

    Jeff Wilkerson  5.026 @ 116.73  4.902 @ 145.47  4.902 @ 145.47

    Jody Voyles    4.973 @ 140.18  4.973 @ 140.18

    Blake Wilder  4.685 @ 151.34  5.161 @ 128.65  5.023 @ 109.83Jeremy Ellis  5.044 @ 133.83  5.044 @ 133.83  5.044 @ 133.83

    Mike Ghee  5.045 @ 137.79  5.045 @ 137.79

    Mike Herring  4.616 @ 151.46  4.669 @ 154.03  4.686 @ 153.23

     

     

    Now to explain it. It's for a drag racing qualifications page. (I'll be using something similar on a pairings tree also)

    In a 4.70 Index class, each car is racing to get as close to a 4.70 E.T. as possible. So you're going for as quick of a time as possible, but trying to not go under 4.70 but as close to it as possible. If you go under it and none of your other qualifying round times are above it, then your highest (closest to 4.70) time would be counted but put behind all other racers who hit over 4.70. So anyone under 4.70 it kind of flips to where you want the highest (still as close to 4.70) and if you're over it where you should be, you want the lowest ET. Though, if you go under let's say a 4.65 and then on another run do a 4.71, your 4.71 would be what counts as it is your "best time". I think the above example has a little bit of all of these examples in it.

     

    The last racer, mike herring didn't get a round over 4.70, so 4.686 was his best since it was closest to 4.70.

    Blake Wilder ran a 4.685 in round 1, but since he ran over a 4.70 in round 3 (5.023) that is the score that will count. This places him above mike herring who only got times under 4.70.

     

    I hope this helps on clarifications. Thanks for your time!

  11. I backed up my table, changed to float. Seems some of my information has been changed to 0.000. I can probably go back and manually enter that stuff back in. Now my problem is similar to what I posted in other thread. If the time is a 0 it shouldn't count in the order by, because that's not a valid qualify time. A 0 means they didn't run a qualify lap and shouldn't be put in qualify position 1 because of it. The other thing is I need to order it to a specific number then flip and continue from that number down. Example:

     

    7.001

    7.024

    7.321

    7.579

    8.168

    21.547

    6.987

    6.575

    6.235

     

    This would be a valid result order. With three qualifying times the only time that the numbers under 7.0 should be at the bottom is if either all three qualifying times are under 7.0 or the ones entered are and the others are either 0 or not entered or w/e

  12. Right now they are varchar, I am up to changing anything that needs to be changed. I started a new thread to explain a little better and put two issues I have in the same post. Sorry for this. Thanks for looking in to this!

  13. Here is my current query:

    $query = mysql_query("
    SELECT registrations.firstname, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.id, participants.cr
    FROM events
    INNER JOIN participants ON participants.eventid = $_GET[event]
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE events.id = $_GET[event] AND registrations.class = '$var'
    ORDER BY LEAST(q1, q2, q3)") or DIE(mysql_error());

    Sorry for the double post, here is what I need to do:

     

    I have a race class like 7.00 Index. You are aiming to get as close to 7.00 as possible without going under. For qualifying (q1,q2,q3 = qualifying rounds 1-3) if someone get's under 7.00, say 6.98 they would go to the bottom of the list. Right now they obviously go to the top. Though, if they come back in round 2 of qualifying and post a 7.045, it should move them up according to the 7.045 number. I have no clue how to go about getting this to work and really hope someone can help me out quickly. I have to have this ready in the next hour or two.

     

    Other problem with query: If I put a double digit such as 21.705 it will move them up above everyone else as if their number is lowest..

  14. $query = mysql_query("
    SELECT registrations.firstname, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.id, participants.cr
    FROM events
    INNER JOIN participants ON participants.eventid = $_GET[event]
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE events.id = $_GET[event] AND registrations.class = '$var'
    ORDER BY LEAST(q1, q2, q3)") or DIE(mysql_error());

     

     

    This seems to work.. UNLESS the number is double digits. So if it's 9.999 it will order correctly with the other results, but if the number for q1, q2, q3 is 10.000 or greater, it puts it above lower numbers.

  15. Maybe this is a mysql question, but I believe it's going to involve php to get it to work out correctly. My current query looks like this:

    $query = mysql_query("
    SELECT registrations.firstname, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.id, participants.cr
    FROM events
    INNER JOIN participants ON participants.eventid = $_GET[event]
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE events.id = $_GET[event] AND registrations.class = '$var'
    ORDER BY LEAST(q1, q2, q3)") or DIE(mysql_error());
    

     

    What we're looking at is q1 q2 q3. I need to take my results, and if all three values (individually not totaled together) are less than a specific set number, say 7.000, then it doesn't grab those results. Then I'll have to run a separate query right after it for those that are under 7.000. I know how to sum the 3 columns but that's not what I need. My entire script for this section is this:

     

    
    $query = mysql_query("
    SELECT registrations.firstname, registrations.lastname, participants.q1, participants.q2, participants.q3, participants.q1s, participants.q2s, participants.q3s, participants.id, participants.cr
    FROM events
    INNER JOIN participants ON participants.eventid = $_GET[event]
    INNER JOIN registrations ON registrations.id = participants.regid
    WHERE events.id = $_GET[event] AND registrations.class = '$var'
    ORDER BY LEAST(q1, q2, q3)") or DIE(mysql_error());
    if(mysql_num_rows($query)!=0){
    
    $content .= "<h3><a name=\"$var\">$var</a></h3>";
    
    
    $query2 = mysql_query("
    SELECT * FROM participants INNER JOIN registrations ON registrations.id = regid WHERE class = '$var' && eventid = $_GET[event] LIMIT 1
    ") or DIE(mysql_error());
    if(mysql_num_rows($query2)!=0){
    	while($r2=mysql_fetch_array($query2))
    	{
    	$testcr = $r2[cr];
    	if ($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') {
    if ($r2[cr] == '0'){
    $content .= "<span style=\"float: right;\"><a href=\"index.php?page=ladders&lock=1&class=$var&event=$_GET[event]\">Lock $var</a></span>";
    } elseif ($r2[cr] == 'ql'){
    $content .= "<span style=\"float: right;\"><a href=\"index.php?page=ladders&unlock=1&class=$var&event=$_GET[event]\">Un-Lock $var</a></span><br /><span style=\"float: right;\"><a href=\"index.php?page=ladders&createp=1&class=$var&event=$_GET[event]\">Create Pairings</a></span>";
    }
    }
    if ($r2[cr] != '0' AND $r2[cr] != 'ql'){
    $content .= "<span style=\"float: right;\"><strong>Pairings Started</strong></span>";
    }
    	}
    }
    
    
    $rn = 0;
    $pos = 1;
    	while($r=mysql_fetch_array($query))
    	{
    	mysql_query("UPDATE participants SET `qp` = '$pos' WHERE id = '$r[id]'") or die(mysql_error());
    
    	$t1 = $r[q1];
    	$t2 = $r[q2];
    	$t3 = $r[q3];
    $rn++;
    
    if ($r[q1] == x) {
    $r[q1] = '';
    } elseif (($t1 == $t2) OR ($t1 == $t3)) {
    if (($t1 > $t2) OR ($t1 > $t3)) {
    } else {
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q1] = "<font color=red>$r[q1]</font>";
    }
    }
    } elseif (($t1 < $t2) && ($t1 < $t3)) {
    
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q1] = "<font color=red>$r[q1]</font>";
    }
    
    
    }
    
    
    
    
    if ($r[q2] == x) {
    $r[q2] = '';
    } elseif (($t2 != $t1) && ($t2 == $t3)) {
    
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q2] = "<font color=red>$r[q2]</font>";
    }
    
    } elseif (($t2 < $t1) && ($t2 < $t3)) {
    
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q2] = "<font color=red>$r[q2]</font>";
    }
    
    
    }
    
    
    
    if ($r[q3] == x) {
    $r[q3] = '';
    } elseif (($t3 < $t2) && ($t3 < $t1)) {
    if ($user->data['username_clean'] != admin AND $user->data['user_id'] != '461' AND $user->data['user_id'] != '205') {
    $r[q3] = "<font color=red>$r[q3]</font>";
    }
    }
    if ($r[q1s] == x) {
    $r[q1s] = '';
    }
    if ($r[q2s] == x) {
    $r[q2s] = '';
    }
    if ($r[q3s] == x) {
    $r[q3s] = '';
    }
    
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<form action=\"index.php?page=ladders&event=$_GET[event]\" method=\"post\" name=\"ladders\">\n";
    }
    
    $content .= "<tr><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; border-top: 0px; border-left: 0px; text-align: right;\">$pos) $r[firstname] $r[lastname]</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1\" value=\"$r[q1]\" size=\"4\" />";
    if(!empty($r[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q1s\" value=\"$r[q1s]\" size=\"4\" />";
    } else {
    $content .= "$r[q1]";
    if(!empty($r[q1s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$r[q1s]";
    }
    
    $content .= "</td><td style=\"line-height: 10px; border: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; border-top: 0px; border-left: 0px; text-align: left;\" align=\"left\">";
    
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2\" value=\"$r[q2]\" size=\"4\" />";
    if(!empty($r[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q2s\" value=\"$r[q2s]\" size=\"4\" />";
    } else {
    $content .= "$r[q2]";
    if(!empty($r[q2s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$r[q2s]";
    }
    
    
    $content .= "</td><td style=\"line-height: 10px; border-bottom: 1px solid #555; border-right: 1px solid #555; padding: 10px; padding-left: 20px; padding-right: 0px; text-align: left;\" align=\"left\">";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3\" value=\"$r[q3]\" size=\"4\" />";
    if(!empty($r[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "<input type=\"text\" maxlength=\"10\" name=\"q3s\" value=\"$r[q3s]\" size=\"4\" />";
    } else {
    $content .= "$r[q3]";
    if(!empty($r[q3s])){
    $content .= " @ ";
    } else {
    $content .= " ";
    }
    $content .= "$r[q3s]";
    }
    $content .= "</td>";
    
    if (($user->data['username_clean'] == admin OR $user->data['user_id'] == '461' OR $user->data['user_id'] == '205') AND $testcr == '0') {
    $content .= "<td> <input type=\"hidden\" name=\"hidden\" value=\"$r[id]\" /><input type=\"submit\" name=\"submitq\" value=\"Post\" /></td></tr></form>\n\n";
    } else {
    $content .= "<td></td></tr>\n\n";
    }
    
    
    $pos++;
    	}
    
    
    
    
    
    
    
    
    
    

     

    (may be missing a bracket or two I just copied a chunk)

     

     

     

    edit: some extra notes - The three columns may not have something in them at all times. So if only q1 has been entered, and it's below 7.000 then it needs to be put to the bottom of the list. Basically here's an example of a correct order:

     

    7.001

    7.123

    7.354

    8.165

    6.954

    6.872

    6.100

     

    Ordering from least to greatest for those OVER 7.000, then the other way around for under it. Though it has to take in to consideration 3 columns and put them in order accordingly to the other columns in the whole thing.

    Here's the page: http://outlawracing.com/index.php?page=ladders&event=1

  16. Not exactly sure what you're after but this example might help...It shows how to get db data and write variables using variable variables.  The variables created are the field(column) names themself and each will equal their value:

     

    $sqlCommand =  "SELECT * FROM table WHERE someField ='something' ";
    $query = mysqli_query($sqlConnect, $sqlCommand); 
    while ($row = mysqli_fetch_assoc($query)) { 
    	foreach($row as $key =>$val){
    		$$key = $val;
    	}
    }
    

     

    I don't think this is going to do it. When I do my while loop, I just want to create a single variable: $pos(valueinthecolumn'qp') = "stuff";

    I want to take the value from the column qp, and attach it to the word pos and create a variable. Essentially as it loops through, it should create: $pos1, $pos2, $pos3, etc

  17. I'm really kind of lost when I get to this stuff. I'm trying to loop through some database results, each one will have a unique number. I need to put it on to a variable name. For example: Each result I need to create the variable $pos#, # = the number grabbed from the database. Then later I can place them where I need them. It's going to be like 1-10 and I'd like to be able to call to them individually.

     

    $pos$r[qp] = "info";

     

    This would basically be the idea.

     

×
×
  • 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.