#mysql
07 October 2007
Total 21 pages. You are browsing page 5/21.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
04:34 <****> No
04:34 <****> VARCHAR's?
04:34 <****> Doesn't matter
04:34 <****> I have it as TEXT now
04:34 <****> It might not display the formatting properly if outputting to a terminal, say.
04:34 <****> MySQL has no concept of formatting. It's all binary data.
04:34 <****> Does it? I think it still displays line breaks and so on literally, actually.
04:34 <****> so, escaping the data would work?
04:34 <****> KI4YJL: What Simetrical is trying to say is that formatting is based off of the client
04:34 <****> KI4YJL: No. MySQL does not change formatting.
04:35 <****> KI4YJL: Explain the problem you're seeing
04:35 <****> some speical characters will have to be escaped with a slash before sent as text.
04:35 <****> SO, I can't make it see another line as, another line
04:35 <****> Well
04:35 <****> I paste 96 lines of code
04:35 <****> KI4YJL: That is up to the client
04:35 <****> store it in a TEXT cell
04:35 <****> then echo it, it is all one line
04:35 <****> KI4YJL: How do you echo it?
04:36 <****> PHP, Perl?
04:36 <****> PHP
04:36 <****> So you're looking at it from a browser?
04:36 <****> yes
04:36 <****> View the source of the HTML page
04:36 <****> it;s formatted!
04:37 <****> tags around your code.
04:37 <****> hmm
04:37 <****>
04:37 <****>
04:38 <****> magic
04:38 <****> thanks!
04:38 <****> y'all wellcom
04:39 <****> yaz
04:39 <****> yayz*
04:40 <****> Also
04:40 <****> Oh, no more questions. You're only allowed one per day.
04:40 <****> heh
04:40 <****> well, I need to find out the highest number in the ID column (auto_increment_
04:40 <****> how do I do that shiz in PHP?
04:41 <****> SELECT MAX(id) AS max_id FROM table;
04:41 <****> cool
04:41 <****> how can I make that a var?
04:41 <****> ....
04:41 <****> $highnum
04:42 <****> KI4YJL, use the return value of mysql_select, like for every query.
04:42 <****> $query = "SELECT MAX(id) FROM table"; $result = mysql_query( $query ) or die( mysql_error() ); list( $highnum ) = mysql_fetch_row($result);
04:42 <****> Simetrical: Huh?
04:42 <****> Er.
04:42 <****> mysql_query.
04:42 <****> wow
04:42 <****> Whatever the thing is called.
04:43 <****> :D
04:43 <****> I like yall better than #php
04:43 * seekwill takes away Simetrical's beer
04:43 * Simetrical is too used to DB abstraction layers, it seems
04:43 <****> they keep beeting around the bush
04:43 <****> KI4YJL: Normally I'm not that nice.
04:43 <****> wowzers
04:44 <****> Simetrical: I'm not a fan of DB abstraction layers.
04:44 <****> DB's aren't "standardize" enough.
04:44 <****> ONE MORE THING
04:44 <****> Dude, you're pushing it
04:44 <****> heh
04:44 <****> header("Location: login.php?sub=");
04:44 <****> I am new, as you can see
04:44 <****> seekwill, MediaWiki manages to support both MySQL and PostgreSQL pretty seamlessly. Mainly because the pgsql maintainer wrote lots of logic to remove all the MySQL-specific stuff, but, still.
04:45 <****> Not possible at all if you use raw database functions.
04:45 <****> how can i inject #highnum after the equal?
04:45 <****> Which also kind of suck for, like, escaping things automatically.
04:45 <****> header("Location: login.php?sub=$highnum");
04:45 <****> KI4YJL: Duh
04:45 <****> really
04:45 <****> I thought it would set sub to '$highnum'
04:45 <****> non-var
04:45 <****> heh
04:45 <****> cool
04:45 <****> Umm...
04:45 <****> Yeah whatever
04:45 <****> KI4YJL, . . . maybe you want to read through the PHP docs? They're actually fairly good.
04:46 <****> Simetrical: Supporting MySQL and PG generally doesn't indicate an "abstraction layer".
04:46 <****> seekwill, why do you say that?
04:47 <****> Simetrical: An abstraction layer usually means separating out DB-specific code, no? So technically you should be able to run on any DB (MSSQL, Oracle, etc.)?
04:48 <****> seekwill, any DB for which someone wrote and maintained an adaptation layer, sure. There's experimental Oracle support but it's probably horribly broken.
04:48 <****> Why wouldn't they use an abstraction layer that already exists?
04:49 <****> I dunno, what are some good examples?
04:49 <****> I could suggest it.
04:49 <****> I don't know, since I don't use them :P
04:49 <****> \o/
04:49 <****> Use ODBC
04:49 <****> Of course support for DB-specific things like FORCE INDEX is necessary for Wikipedia to not spontaneously explode.
04:49 <****> Exactly why I don't like abstraction layers.
04:50 <****> IMHO, the concept doesn't work very well with databases.
04:50 <****> We fix that by writing the inline code for MySQL and letting the PostgreSQL guy fix up stuff that doesn't work for him on his side. :D
04:50 <****> Okay
04:51 <****> n
04:51 <****> m
04:51 <****> But yes, that implies that probably pgsql will not run as well as mysql, unless it's just so awesome its queries don't need fine-tuning.
04:51 <****> l
04:51 <****> k
04:51 <****> j
Total 21 pages. You are browsing page 5/21.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
