Sponsored by Best Buy
The camera starts rolling on Best Buy holiday campaign. view!
www.youtube.com/bestbuy - A behind the scenes look at one employee’s singing debut.
100 Comments
- MasterThief117, on 01/19/2008, -0/+53As easy as 3.141592653589793238462643383...
- LysolSCG, on 01/19/2008, -2/+34So it automatically assumes you have Cpanel...
Easy as pie.... With a Cpanel $900 license. - jswoods7, on 01/19/2008, -1/+21Link is not working for me. Getting "Error establishing a database connection"
- Speck, on 01/19/2008, -0/+19I guess you're an expert, then, in Actionscript, Ruby, Python, PHP, ASP.Net, Javascript, Photoshop layers and effects, XML, XSLT, SQL, CSS, XHTML, etc.?
Everyone at one time or another is a noob at something. Should they be prevented from posting to Digg?
You were a noob once, too, and if people looked down their nose the same way you are now, you wouldn't be *****.
I'd take 20 noobs over one arrogant prick any day. - bubbles19518, on 01/19/2008, -1/+15Or you bought a $5 shared hosting account on one of hundreds of servers...
- nitsnipe, on 01/19/2008, -0/+14 No, it automatically assumes you got it illegaly but for educational purposes.
- guytoronto, on 01/19/2008, -1/+13Step 1: Get a server that can handle real traffic.
- sensor, on 01/19/2008, -0/+10That code is so bad...
- ShouldBeStudyin, on 01/19/2008, -1/+11Ironic that there would be a database error ("Error establishing a database connection") when trying to read an article about MySQL.
- NeMoD, on 01/19/2008, -1/+10or if you have any host worth a damn
- Firehed, on 01/19/2008, -0/+9It's done just as easily with PHPMyAdmin, which IS free.
But this guide is really aimed at people who are using the above-mentioned $5 shared hosting that includes Cpanel. - Error601, on 01/19/2008, -0/+8Ironic getting a "Error establishing a database connection" on an article about using a database?
In any case, the problems I find are not people that know how to use a DBMS but people that don't know how the design a database. Constraints are not novelties that you don't really need. - FatLoser, on 01/19/2008, -0/+7I ran into a few people who could recite pi to the x-hundredth digit. I was all like... who gives a *****? And they were all like... you just don't understand; it's cool to be able to recite completely random digits that have no pattern whatsoever, and the recitation of which ensures delayed loss of virginity. And I was all like... whatever!
- seantubridy, on 01/19/2008, -0/+6Oooohhhh I get it. Ha ha.
- pudly, on 01/19/2008, -1/+6how ironic: "Error establishing a database connection"
edit: i should probably read other posts prior to my attempt at being witty - jcaino, on 01/19/2008, -0/+5yea, really. don't use cPanel here, but creating a database is just as easy - just input the database name, click the button, and viola! done. phpMyadmin is available right there too.
- rzermatt, on 01/19/2008, -0/+4Step 2: Put your junk in that server.
- fate3, on 01/19/2008, -0/+4turns out its not so easy after all
- duniyadnd, on 01/19/2008, -0/+4That is your first lesson. What is "error establishing a database connection".. too bad they didn't explain it. :)
Why can't folks just use documentation provided by mysql.com itself?? - SpookyET, on 01/19/2008, -1/+5Easy-As-Pie:
"Error establishing a database connection"
That's the shortest MySQL tutorial ever;-) - an8kid, on 01/19/2008, -0/+3sadly i know pi to about 27 dec places in my head. I know i cant prove it, but its true!
..the next number is a 5 - bradleyland, on 01/19/2008, -0/+3WRONG!
- surge1, on 01/19/2008, -0/+3easy as Irony
- Niubai, on 01/19/2008, -0/+3It would be pretty cool to hit F5 several times after that form submit ...
- borez, on 01/19/2008, -0/+3Error establishing a database connection
- dpierce, on 01/19/2008, -0/+3What would your improved code look like?
- SteaminTmann, on 01/19/2008, -1/+4Ohhh the irony..
- eighties, on 01/19/2008, -1/+4He uses $htmlentities to prevent possible XSS attempts when echoing out database values, but never bothers to sanitize the input in the first place, leaving the whole system wide open for SQL injection. That's a great way to have your data compromised and/or DROPed.
- JoeRW, on 01/19/2008, -0/+3The order by rand() is not so great for very large 5000+ row tables because it assigns a random number to every record in the database and then orders them. It's much faster to get the random row via programming code ie
SELECT COUNT(*) AS num FROM quotes
generate a random number $rnd between 0 and num-1 in code then do
SELECT quote FROM quotes LIMIT $rnd, 1 - stuckinOK06, on 01/19/2008, -0/+2mirror, please?
- unversed, on 01/19/2008, -0/+2*****, I can't believe I clicked on that. You suck!
- Tippis, on 01/19/2008, -0/+2(define improved-code (lambda (improver code) (improver (improved-code improver code))))
- eighties, on 01/19/2008, -0/+2The code that you posted was added _after_ the original article was dugg. If you check the google cache (in the comment by dwalker above), the original query was :
$query="INSERT INTO `quotes` (`quote`,`author`) values ('" . $quote . "','" . $author . "')";
Which does nothing to prevent SQL injection. The modified code at least attempts to prevent such problems. Good of him to change the code, as well. It shows that he reads the comments on his own article. - tgc1, on 01/19/2008, -0/+2Or you could just learn how to do it yourself. ***** people are lazy. PHP/MySQL ain't hard.
- AmazingAndrex, on 01/20/2008, -0/+2Step 3: Make them open the server.
And that's the way you do it. - guytoronto, on 01/19/2008, -0/+2Step 3: Have her open that server.
- themoosejuice, on 01/19/2008, -0/+2SITE DEAD - 403 Forbidden - Digg strikes again.
- Scriptor, on 02/04/2008, -0/+1Is it that hard to get a good book and read it? Oh, sorry, it actually costs money, paying money to learn a language that you're unfamiliar to from the ground up, and then try to build production websites with, pshh.
Go find a place with reviews for tech books (Amazon for example), get one, read it. Then start some projects to practice with, and use the docs for reference and to learn the details. Once you're used to the language, find some well-written code and study it (PHP frameworks for example). PHP/MySQL is simple, sure, but it takes alot more than knowing "working with a database" to build a database-driven site. - stutimandal, on 01/19/2008, -0/+1The random quote generator algorithm, using rand() function in mysql, works really slow on large database tables.
You should count the number of rows (or use the max-primary key id) and then generate a Uniform Random row to be drawn using Php/scripting language. - inactive, on 02/21/2008, -0/+1Step 3: Cut a hole in the box...
- EXreaction, on 01/19/2008, -0/+1Or you can check out the Session Manager I've built. Lets you easily register/login/track sessions, even hashes the passwords with phpass.
http://www.lithiumstudios.org/forum/viewtopic.php? ... - Niubai, on 01/19/2008, -1/+2Two words for the new at *SQL: Stored Procedures. Take note.
- RTPMatt, on 01/19/2008, -0/+1I only know the SQL i have taught myself, so im hoping someone can give me a little help. Reading the code, it seems to me their SELECT line is odd to me:
$query="SELECT `quote`, `author` FROM `quotes` ORDER by rand() LIMIT 1";
It seems a very odd use of ORDER By to me, i would have had an auto incrementing key field, and done a SELECT * WHERE key=rand() type thing.
What do you guys think? - jonester, on 01/19/2008, -0/+1Database error? I want to learn SQL from you!
- noinput, on 01/21/2008, -0/+1pie has never been that easy for me to make.
- joelhardi, on 01/20/2008, -0/+1Also, "SELECT *" is generally considered bad programming practice. From a pure database server-performance perspective there's no difference between enumerating all the columns and using * (provided you actually *need* to select all the columns in your table ... usually you don't in which case it's a waste to select the extra fields). However, "SELECT *" makes your program harder to read, and what happens when you change your schema or your query? Here, this guy with cool haircut will explain more. http://searchoracle.techtarget.com/ateQuestionNRes ...
- jorge1087, on 01/19/2008, -0/+1sooooooooo good
- tempusrob, on 01/20/2008, -0/+1Why do people still not use PDO? :(
- vibrokatana, on 01/19/2008, -0/+1Working via the GUI tools supplied via the MySQL website is easier IMO. Especially when you are designing your database schema and setting up stored procedures/functions. This only really helps for those without root on their server (I run my own VPS). Even then it is pretty much common sense and in the ***** manual for cPanel...
- aleos, on 10/20/2008, -0/+0http://www.myalem.net
-
Show 51 - 100 of 107 discussions




What is Digg?