| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Comments:
<0> hmmm i figured out... :) thanx anyway. <0> i am writing a new script now <1> all it takes is one query <2> http://www.zaman.com/?bl=hotnews&alt=&trh=20060224&hn=30169 <-someone got their facts jumbled up <3> just a little bit <3> hardly noticable <2> 1000th download? 1069 GB ipod? <3> heh <3> that's one big ipod <2> that's what I'm saying, how long is the battery going to last one that one? <4> what battery? that bitch plugs into the wall <4> and sits on a shelf or something. <2> http://spi.iichan.net/fb/src/1140862078748.jpg <5> Which is the easiest way to check if a mysql database exists, or a certain table exists? <3> show databases;
<3> show tables; <3> run through the results, and see if it exists <5> Does that take much processing time? <3> here, even better <3> @mysql_list_dbs! <6> (PHP 3, PHP 4, PHP 5) <6> resource mysql_list_dbs ( [resource link_identifier] ) <6> List databases available on a MySQL server <6> http://www.php.net/mysql-list-dbs <3> @mysql_list_tables! <6> (PHP 3, PHP 4, PHP 5) <6> resource mysql_list_tables ( string database [, resource link_identifier] ) <6> List tables in a MySQL database <6> http://www.php.net/mysql-list-tables <5> oh, how could i have missed that? Thanks spox :) <5> Is there a mysqli way? <7> uhm why does LIMIT return 5 records when doing LIMIT 4,8? <7> even LIMIT 4,7, etc <7> ah h, <5> 4,8 = number 4 is the last one, 8 is the number of entries before that. 0-4 <7> hmm <7> 0-4 works <7> but when it goes 4-8 it borks out and returns 5 results <7> but yeah let me try reversing thoughs <7> those <5> I THINK it's that way ... :) pretty sure <7> LIMIT 4,0 returns none <7> LIMIT 0,4 returns 4 <7> LIMIT 4,8 returns 5 <7> wtf? <2> isn <2> 't that a range? <5> to get 1-10 when it's 100 entries, you have to check the number of entries, then substract this with the number of entries that you want to get out... so in this case LIMIT (100-90), 10 <2> I've never used LIMIT %d,%d, but from what you're saying, it sounds like it's a range <7> yeah i was using it like a range <2> well 4-0 would return 0 <7> get result 4 - 8 <7> yeah <7> 0 - 4 returns the first 4 sets <7> liberum: thans man ill give that a try <7> ahh ok i see how i was using that wrong <5> if (isset($_GET['page'])) { $first = $_GET['page']; } $last = ($first - 1) * $setting['objectsperpage']; <5> $query = "SELECT * FROM " . $setting['dbobjecttable'] . " WHERE type = '$type' ORDER BY title ASC, id DESC LIMIT " . $last . ", " . $setting['objectsperpage']; <5> That's how I done it <7> ahhh you know exactly what im doing too heh <5> Hehe good guess <7> indeed <5> well, $first = 1; should be first of all that... so it's counting from 0 if the user havn't choosen a page <7> yeah i have all of that already <7> it was just my mysql statement was wrong <7> and how i was using limit <5> I took the code from someone else to... didn't seem logical to me ether <7> hm <7> all fixed <7> now to fix the html\table print out :X <5> yeay <5> I just discovered ob_start().. it's great... makes it possible to change the headers even if the header is allready set (well, it isn't because ob_start buffers it) <2> sounds like some stank *** code to me <1> ob_start doesn't buffer headers <2> it buffers This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. <1> pwn
<5> I know it says so, but it works fine with header("Location: index.php"); anyway <1> it's a terrible thing to do. <1> waste of memory <1> waste of resources altogether <5> Sometimes it's the only way :-/ <1> no it's not <1> i've never had to use output buffering to send headers <1> ever. <5> What should I do then when sessions are set and i have to redirect someone? <1> redirect them before you send output. <5> How? Print everything to a variable and print it in the end? <7> session info gets p***ed over the browser on redirects ;/ <1> no, check for the redirect first. <5> Rashonda22F: What if I need sessions to know if the person has the right to be redirected? :) <1> what's that have to do with anything? <1> sessions are part of the header <5> Give us an example <1> session_start(); if ($_SESSION['pants'] == "cuntflaps") { header('Location: http://www.google.com'); } <5> eh, it sais that headers are allready sent? <1> no it doesn't <5> just because of the if question? <1> what? <5> yeah, what? :) <1> there is absolutely nothing that would stop that code from working <5> I'm 99 % sure... does print "Hey..."; header("Location: index.php"); works also? <1> no <1> because print "" ends the header <5> aha.. hum... <1> do you not get the idea behind "header"? <1> head is on top of the body.. <5> yes I do... <8> haha <5> I'll check for it later... maybe I was wrong all the time :) Thought it was stupid that you couldn't redirect someone with sessions on <1> sessions are just cookies and a file <3> wow <3> do you even know what the **** you are talking about? <5> spox: That's mature. Helps everyone. <3> i'm not talking to you <5> sorry then :) <3> you are getting the headers already sent error because you can't print anything to the client until all headers are sent <3> headers have to go first <3> so your print "hey"; .. header(...); <3> won't work <3> unless you are using a buffer <3> like the ob functions <5> Hum, some header information should be "on top" automaticly..? <3> what do you mean? <5> spox: Is it stupid to use ob_start() on top and ob_end_flush() on bottom? <1> there are two headers that are automatically sent <1> 200 and content-type <3> well, if you don't actually need it, there's not much point <3> and most of the time, you don't actually need it <1> the only time i use ob is for caching pages <5> heh the is no point in using ANYTHING you don't have a need for <3> then don't use the ob functions <5> spox: Any idea how to solve it in a better way? <1> .. <2> write better code <1> send your header first. <1> voila. <3> use both of those answers <3> not one or the other, both <5> If the code is really big then there will be occasions when the error comes... :-/ Of course you could plan the code for a weak or so, but it's not that important <2> Rashonda22F, So are you a male trying to get PHP help through being an IRC transvestite? or are you truly a female and follow the "ugly OR fat OR crazy" rule? <1> i'm fat AND ugly <5> :) <8> "poutine - write better code" <-- best advice on the net <9> hi! <9> if i have this in a line; <9> zone "truegrave.net" { <9> is there a way just to grab the domain <9> and ignore the test <9> rest <3> @php $a = 'zone "truegrave.net" {'; print substr($a, strpos($a, '"'), strrpos($a, '"'));
Return to
#php or Go to some related
logs:
decoding SourceCop #allnitecafe +kiam kana #india chatword words with man
validate date in perl #india amazon s3 c++ girl-n-girl Juhi Vikram
|
|