Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
- snipz -
Does anyone know how I can mass update a value in phpmyadmin?
[IMG]http://u.cubeupload.com/callamkidsloft/Capture.png[/IMG]
I need to change subscriber status to 1 for like 10,000 entries lol
[QUOTE=xianlee;43156825]Does anyone know how I can mass update a value in phpmyadmin?
[IMG]http://u.cubeupload.com/callamkidsloft/Capture.png[/IMG]
I need to change subscriber status to 1 for like 10,000 entries lol[/QUOTE]
This should do it. Altho I'm not sure with the quotes as I wrote this from my phone..
[CODE]
UPDATE `table` set `subscriber_status` = '1'
[/CODE]
[QUOTE=xianlee;43156825]Does anyone know how I can mass update a value in phpmyadmin?
[IMG]http://u.cubeupload.com/callamkidsloft/Capture.png[/IMG]
I need to change subscriber status to 1 for like 10,000 entries lol[/QUOTE]
UPDATE tablename SET subscriber_status = 1
[B]Edit:[/B] damn
@Svenskunganka no quotes around the 1 because it's not a string.
so would it be
UPDATE 'newsletter_subscriber' SET 'subscriber_status' = 1
(newsletter_subscriber is the table name)
or would it work without quotes too?
[QUOTE=xianlee;43156918]so would it be
UPDATE 'newsletter_subscriber' SET 'subscriber_status' = 1
(newsletter_subscriber is the table name)
or would it work without quotes too?[/QUOTE]
There are two types of single quote ' and `. In mysql ' is used to indicate a string ` is used around table and column names. You only need to use ` when the name is a reserved keyword [url]http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords-5-5.html[/url].
So just use:
UPDATE newsletter_subscriber SET subscriber_status = 1
Aha, that did the trick, thanks a lot!
I did Google it before asking here but I was getting results from like 2007 so didn't want to risk it.
Edit:
When using clearfix in web design, do you put it after say all 3 floated items or each individual float?
How can I hack the textarea to react on pressing the enter key it submits the form instead of a new line and for example doing SHIFT + ENTER it goes to a new line? Tried Googling it however the results wasn't what I needed, perhaps I just suck at Google. :v:
[QUOTE=Moofy;43157278]How can I hack the textarea to react on pressing the enter key it submits the form instead of a new line and for example doing SHIFT + ENTER it goes to a new line? Tried Googling it however the results wasn't what I needed, perhaps I just suck at Google. :v:[/QUOTE]
[url]http://jsfiddle.net/alexsuch/qM85H/[/url]
Just been doing some PDO database work for the first time but it doesnt work:
[code]
$title = $_POST['title'];
$dbsn = 'mysql:dbname=testing;host=127.0.0.1';
$database = new PDO($dbsn, $user, $password);
$statement = $database->prepare('INSERT INTO cont (user, language, title, content, rating, listed) VALUES (?, ?, ?, ?, ?, ?)');
$statement = $database->execute(array('none','English', $title, content, 0, 1));
[/code]
[code]
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000] [1044] Access denied for user ''@'localhost' to database 'testing'' in
testing/sub.php:17 Stack trace: #0 /testing/sub.php(17): PDO->__construct('mysql:dbname=tes...', 'none', '') #1 {main} thrown in /testing/sub.php on line 17
[/code]
Is what im getting back from it.
[QUOTE=xianlee;43157537][url]http://jsfiddle.net/alexsuch/qM85H/[/url][/QUOTE]
You are my master, thank you!
[QUOTE=Chizbang;43158997]
[code]
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000] [1044] Access denied for user ''@'localhost' to database 'testing'' in
testing/sub.php:17 Stack trace: #0 /testing/sub.php(17): PDO->__construct('mysql:dbname=tes...', 'none', '') #1 {main} thrown in /testing/sub.php on line 17
[/code][/QUOTE]
[1044] Access denied for user ''@'localhost' to database 'testing'
You are trying to connect to your database server with no username (see ''@'localhost').
[QUOTE=xianlee;43156984]Aha, that did the trick, thanks a lot!
I did Google it before asking here but I was getting results from like 2007 so didn't want to risk it.[/QUOTE]
Generally older stuff is fine for SQL because SQL syntax doesn't change very fast.
[QUOTE=xianlee;43156984]When using clearfix in web design, do you put it after say all 3 floated items or each individual float?[/QUOTE]
It depends what kind of clearfix you're using.
[QUOTE=Khub;43159651][1044] Access denied for user ''@'localhost' to database 'testing'
You are trying to connect to your database server with no username (see ''@'localhost').[/QUOTE]
But didnt I give the username under this?
[code]
$database = new PDO($dbsn, $user, $password);
[/code]
[QUOTE=Chizbang;43159997]But didnt I give the username under this?
[code]
$database = new PDO($dbsn, $user, $password);
[/code][/QUOTE]
Are you actually setting $user? I don't see it in your post. If you are, maybe there's a typo in the variable name?
Basically, I've been out of work for 2 months so I just started learning Ruby on Rails on my own a few days ago. Lots of jobs are asking for it and I figured while I'm looking for work I might as well go for it. In the process I'm also figuring out Github. Ruby is not my first language (Java, Javascript, PHP, VB.NET, etc) but the first I'm learning on my own outside of college.
Anyway, one of the other common requirements is Linux experience (with Ubuntu being the most common one I've seen so far). Do you have a personal suggestion here? Also, using Ubuntu as an example, I see it can be booted off USB. Should I stick to dual-booting it or would doing development work off of USB be fine?
Go with Gentoo
[QUOTE=FlakAttack;43162987]
Anyway, one of the other common requirements is Linux experience (with Ubuntu being the most common one I've seen so far). Do you have a personal suggestion here? Also, using Ubuntu as an example, I see it can be booted off USB. Should I stick to dual-booting it or would doing development work off of USB be fine?[/QUOTE]
Ubuntu is a great starting point for beginners due to the wealth of information and guides available, you can google a problem + "ubuntu" and it's almost guarantee that you will find a solution quickly and it as a huge number of packages in the repositories. The only downsides are the remote search in the dash (easily disabled via graphical way or [url=https://fixubuntu.com/]this[/url]) and the lack of personalization in their desktop environment - you can easily change it to gnome, kde, xfce, cinnamon, razor qt, (...) though.
The only downside of linux is support from developers, mainly drivers and games, but valve is changing that...
I suggest trying ubuntu, mint, fedora (my favorite) or openSuse in a virtual box first, after you can stick with it, dual-boot or have a laptop/pc just for it, the last option is for healthy people and non-gamers.
[editline]12th December 2013[/editline]
Oh, and mac is cool too...
I dont know if this fits in here but are there any good stock photo websites where it is free or reasonably cheap?
[QUOTE=asantos3;43163518]Ubuntu is a great starting point for beginners due to the wealth of information and guides available, you can google a problem + "ubuntu" and it's almost guarantee that you will find a solution quickly and it as a huge number of packages in the repositories. The only downsides are the remote search in the dash (easily disabled via graphical way or [url=https://fixubuntu.com/]this[/url]) and the lack of personalization in their desktop environment - you can easily change it to gnome, kde, xfce, cinnamon, razor qt, (...) though.
The only downside of linux is support from developers, mainly drivers and games, but valve is changing that...
I suggest trying ubuntu, mint, fedora (my favorite) or openSuse in a virtual box first, after you can stick with it, dual-boot or have a laptop/pc just for it, the last option is for healthy people and non-gamers.
[editline]12th December 2013[/editline]
Oh, and mac is cool too...[/QUOTE]
Thanks, great answer. My hardware is all pretty common, though my peripherals are all gaming gear so I'm a little worried about it all working. Either way it won't hurt.
My Linux install is really just going to be a web development environment. As far as games go, I'll still have Win 7 so I don't mind at all.
So I just got my website up and hosted, and I can't get the favicon working.
example.com goes to my page, but even though I have favicon.ico working on my local copy (and the version of the website that was on example.com/admin and example.com/admin/index.html) it won't show up when I try to add it on the normal page. I've changed the index around to reflect various locations for the favicon and tried moving it all over the server. Is there a special location that you need to put a favicon to make it work on a web server?
Should work (for most hosts) in the base folder (where your original index.* file is) and include it automatically. If not you can add through the html or even through .htaccess. I'm on phone though sorry so can't really help.
Probably you have it correctly placed and it's just your browser using a cached one. Try with Chrome on inspect mode, or any browser you don't usually use.
Is it possible to make it so that when your website is viewed at less than a certain pixel range it swaps to mobile?
E.g if a mobile device width is less than 1024px + a desktop browser window swap to mobile.css
[QUOTE=xianlee;43172392]Is it possible to make it so that when your website is viewed at less than a certain pixel range it swaps to mobile?
E.g if a mobile device width is less than 1024px + a desktop browser window swap to mobile.css[/QUOTE]
I believe what you're looking for is media queries
[url]http://www.htmlgoodies.com/html5/tutorials/an-introduction-to-css3-media-queries.html#fbid=zvNrcmcqwlY[/url]
[QUOTE=xianlee;43172392]Is it possible to make it so that when your website is viewed at less than a certain pixel range it swaps to mobile?
E.g if a mobile device width is less than 1024px + a desktop browser window swap to mobile.css[/QUOTE]
@media screen and (min-device-width:100px) and (max-device-width:1024px)
{
Inser Css here
}
min-width:100px
Then it will change when you make your browser window smaller
min-device-width:100px
It will only trigger if you are on a phone, tablet...
Is there any good snow scripts out there that look good and wont cause tons of cpu lag if theres to many objects on the screen?
This is the best one I've come across: [url]http://schillmania.com/projects/snowstorm/[/url]
Thanks for the guides above.
For people with image(/other files)-sharing pages:Do you recommend any kind of ToS template/generator/editor ? Same with privacy policy.
I thought about it, and I'll probably need one, so I wanted to know if there's anything preferred.
Sorry, you need to Log In to post a reply to this thread.