Jump to content

king arthur

Members
  • Posts

    335
  • Joined

  • Last visited

    Never

Everything posted by king arthur

  1. [quote author=simao20 link=topic=94275.msg377257#msg377257 date=1148635199] nothing, a complete blank screen. [/quote] If that's the case it is probably not actually including layout.php at all but you are not seeing the errors. I do believe the line should be [code] include($_SERVER['DOCUMENT_ROOT'] . '/layout.php'); [/code] Try that and also have a look at the error settings in your php.ini file.
  2. [quote author=dixie link=topic=94275.msg416752#msg416752 date=1155728484] I have the same blank screen and I downloaded the files from Sybex. All my other PHP scripts work fine. Source code of blank page is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD> <BODY></BODY></HTML> This is the second book and none of the source code actually works (carp) [/quote] That's not the same script, since the doctype is completely different.
  3. What does the shops.code column have in it? Try posting the actual code you're using.
  4. No I don't think you can do that. Why not make your connection code into a function and pass in the database name as a parameter?
  5. Don't know but see what happens if you change the line [code] if($ll = 'g'){ [/code] to [code] if($ll == 'g'){ [/code]
  6. A quick check through the visitor stats on one of my sites shows that out of 2260 visitors so far this month only 104 did not reveal client side info meaning they probably did not have javascript enabled. Less than 0.5% then.....and 24 of them were search bots!
  7. Well I'm assuming he meant [code] <?php $your_array = array( array (       [pnam] => gombi1       [con] => santachaos       [crnk] => rfss       [div] => -       [time] => 15.07.2006 12:52       [mod] => 15.07.2006 22:59       [ip] => 84.50.16.93       ) array (       [pnam] => obstgrf       [con] => obstgrf       [crnk] => obstgrf       [div] => -       [time] => July 15 2006 23:30:47.       [mod] => Not traced yet       [ip] => Not traced yet       ) ) ?> [/code] but perhaps he didn't.
  8. Okay, for multi-dimensional arrays you need a usort. Sounds scary but easy really. First you define a function: [code] <?php function sort_on_crnk($x, $y) { if($x['crnk'] == $y['crnk']) return 0; if($x['crnk'] < $y['crnk']) return -1; return 1; } ?> [/code] Now you just do [code] usort($your_array, 'sort_on_crnk'); [/code] HTH.
  9. Well yes, that would be the problem. You have already started rendering the page by the time the PHP script is included, hence the "headers already sent" error.
  10. [quote author=Nothadoth link=topic=104275.msg415834#msg415834 date=1155599652] how would i use a while loop to display links to all categories if it has a column with it in? i thought of it before [/quote] Well, how are you defining your categories?
  11. Have another column for category. Auto-increment is designed for ID columns, you should just let it do its job.
  12. ++ means post-increment. The line "$total = $res++" means "assign the value of $res to $total, and then increase $res by 1".
  13. If you mean in terms of monthly server bandwidth limits, it's......err, the size of the file?
  14. Ummm.....what are these statements supposed to do? [code] $rowban['bannedip']; and $row['userip']; [/code] and why do you close the connection to the database and immediately re-open it?
  15. Generally speaking using globals to solve problems like this is considered bad programming in many quarters - you should pass the variables in as parameters to the functions that need them.
  16. Actually your first query should be [code] SELECT points.1 FROM points, schedule WHERE points.name= schedule.name AND schedule.week = '1' AND schedule.team = 'tm1' [/code] Note the comma not full stop, between the table names.
  17. Probably because the column names are not legal! Try changing them to 'one' and 'two', it's the only reason I can see why your query produces an error. When you've done that, you can do "select week, team, schedule.name, one, two from schedule, points where schedule.name=points.name" then you will get the all the teams with all the points scored by the player in the team for week one and week two, week by week.
  18. Doesn't look like there's anything actually wrong with that code. Your FOR loop will do exactly the same each tiime as the IF statement tests the same variable each time, so of course you will get all the rows the same.
  19. So, the column names in the points table are 'name', '1', and '2'?
  20. [quote author=bltesar link=topic=103746.msg413418#msg413418 date=1155237717] doesn't arsort preserve the key=>value relationships, and so the assocaition between names and points should be preserved? [/quote] How can it if they are in two separate arrays?
  21. You need to put this data into the same array, otherwise when you sort the array with the points in it you will lose the association with the names. E.g. $name_and_points = array(array("name"=>"John", "points"=>7),                                          array("name"=>"Peter", "points"=>8 ),                                          array("name"=>"Jeff", "points"=>2)); Then do a usort on the points column.
  22. [quote author=SharkBait link=topic=103739.msg413329#msg413329 date=1155229573] Out put your variables. I had to do that when I was working with my pagnation scripts. I found that my $prevpage kept equalling my $page So I changed $prevpage to be set up like [code] <?php $prevpage = $page - 1; ?> [/code] Which is odd cause I thought $page--; would work but it didnt seem to for some reason??? [/quote] The reason that doesn't work is because what it actually does is assigns the value in $page to $prevpage, and then decrements $page. So if you started with $page = 2, you would end up with $prevpage = 2 and $page = 1.  Not what you wanted.
  23. You've forgotten the table cell tags in your while loop. [code] while($kolonne < $kolonner)   {     echo "<td>" . $text . "</td>";     $kolonne++;     $counter++;   } [/code]
  24. It could be a lot of things. It could be your version of PHP or your error settings. You could put the line "phpInfo();" near the start of your script just temporarily and see what you can make of the info it prints out.
×
×
  • 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.