• Web Development Questions That Don't Need Their Own Thread v2
    3,079 replies, posted
Some editers/IDE's have that feature where if you highlight something it'll highlight all the other instances of it. That probably would have helped you out there. Because I usually just go highlighting everything when something doesn't work.
[QUOTE=zzlawlzz;30316086][php]$stmt = $dbh->prepare("INSERT INTO person (username,password,random,activated,regdate,email,ip,realname,location,steam,twitter,about,youtube,banned,bannedreason,activationkey) VALUES(:username,:password,:random,:activated,:regdate,:email,:ip,:realname,:location,:steam,:twitter,:about,:youtube,:banned,:bannedreason,:activationkey)"); //username,password,random,activated,regdate,email,ip,realname,location,steam,twitter,about,youtube,banned,bannedreason,activationkey $stmt->bindParam(':username', $user); $stmt->bindParam(':password', $pass); $stmt->bindParam(':random', $random); $stmt->bindParam(':activated', $zero); $stmt->bindParam(':regdate', $today); $stmt->bindParam(':email', $mail); $stmt->bindParam(':ip', $ip); $stmt->bindParam(':realname', $nap); $stmt->bindParam(':location', $nap); $stmt->bindParam(':steam', $nap); $stmt->bindParam(':twitter', $nap); $stmt->bindParam(':about', $nap); $stmt->bindParam(':youtube', $nap); $stmt->bindParam(':banned', $zero); $stmt->bindParam(':bannedreason', $nap); $stmt->bindParam(':acticationkey', $activate); $user = $_POST['user']; $pass = $_POST['pass']; //$pass = hash('sha512',$_POST['pass']); $random = $codegen1; $today = date("m/d/y"); $mail = $_POST['mail']; $ip = $_SERVER['REMOTE_ADDR']; $nap = "n/a"; $activate = $codegen; $zero = "0"; $stmt->execute();[/php] What am I doing wrong? [code] Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /home/zzlawlzz/public_html/testing/register.php on line 65[/code][/QUOTE] other than acticationkey is there anything else wrong with it? because there wasn't any error, but doesn't seem to put it on mysql. I tried putting everything before I bind it. [editline]8th June 2011[/editline] I also echoed everything (not the PDO things) and it works fine.
[QUOTE=jaybuz;30318381]Some editers/IDE's have that feature where if you highlight something it'll highlight all the other instances of it. That probably would have helped you out there. Because I usually just go highlighting everything when something doesn't work.[/QUOTE] This is why I prefer N++ over Sublime text.
[QUOTE=zzlawlzz;30318549]other than acticationkey is there anything else wrong with it? because there wasn't any error, but doesn't seem to put it on mysql. I tried putting everything before I bind it. [editline]8th June 2011[/editline] I also echoed everything (not the PDO things) and it works fine.[/QUOTE]try to catch any exception that occurs
[QUOTE=zzlawlzz;30318549]other than acticationkey is there anything else wrong with it? because there wasn't any error, but doesn't seem to put it on mysql. I tried putting everything before I bind it. [editline]8th June 2011[/editline] I also echoed everything (not the PDO things) and it works fine.[/QUOTE] $random = $codegen1; is undefined. [editline]8th June 2011[/editline] nor is $activate = $codegen; defined, don't know if that's the problem but you could try holding there place with a string.
[QUOTE=hacksore;30318662]$random = $codegen1; is undefined. [editline]8th June 2011[/editline] nor is $activate = $codegen;[/QUOTE] "I also echoed everything (not the PDO things) and it works fine."
[QUOTE=zzlawlzz;30318691]"I also echoed everything (not the PDO things) and it works fine."[/QUOTE] They way your trying to bind stuff is not correct, StinkyJoe correct me if I'm wrong but I believe this is the correct way to prepare a statement: [php] $username = "Derp"; $qry = $dbh->prepare("INSERT INTO tbl_name (username,time) VALUES (:username,:time)"); $qry->bindParam(":username", $username, PDO::PARAM_STR); $qry->bindParam(":time", time(), PDO::PARAM_STR); $qry->execute(); [/php] Notice how I didn't define the vars after they were bound.
[QUOTE=hacksore;30318978]They way your trying to bind stuff is not correct, StinkyJoe correct me if I'm wrong but I believe this is the correct way to prepare a statement: [php] $username = "Derp"; $qry = $dbh->prepare("INSERT INTO tbl_name (username,time) VALUES (:username,:time)"); $qry->bindParam(":username", $username, PDO::PARAM_STR); $qry->bindParam(":time", time(), PDO::PARAM_STR); $qry->execute(); [/php] Notice how I didn't define the vars after they were bound.[/QUOTE] what happened to [php] $username = "Derp"; $qry = $dbh->prepare("INSERT INTO tbl_name (username,time) VALUES (:username,:time)"); $qry->execute(array("username" => $username, "time"=> time())); [/php]
[QUOTE=Ac!dL3ak;30320189]what happened to [php] $username = "Derp"; $qry = $dbh->prepare("INSERT INTO tbl_name (username,time) VALUES (:username,:time)"); $qry->execute(array("username" => $username, "time"=> time())); [/php][/QUOTE] This is the shorthand method? Will try it out right now.
[QUOTE=hacksore;30318978]They way your trying to bind stuff is not correct, StinkyJoe correct me if I'm wrong but I believe this is the correct way to prepare a statement: [php] $username = "Derp"; $qry = $dbh->prepare("INSERT INTO tbl_name (username,time) VALUES (:username,:time)"); $qry->bindParam(":username", $username, PDO::PARAM_STR); $qry->bindParam(":time", time(), PDO::PARAM_STR); $qry->execute(); [/php] Notice how I didn't define the vars after they were bound.[/QUOTE] bindParam stores a reference to $variable ($username in this case), not the contents of it. The ordering of binding and declaring doesn't matter. [editline]7th June 2011[/editline] But, you do need to declare the variable before executing the statement.
[QUOTE=zzlawlzz;30316086][php]$stmt = $dbh->prepare("INSERT INTO person (username,password,random,activated,regdate,email,ip,realname,location,steam,twitter,about,youtube,banned,bannedreason,activationkey) VALUES(:username,:password,:random,:activated,:regdate,:email,:ip,:realname,:location,:steam,:twitter,:about,:youtube,:banned,:bannedreason,:activationkey)"); //username,password,random,activated,regdate,email,ip,realname,location,steam,twitter,about,youtube,banned,bannedreason,activationkey $stmt->bindParam(':username', $user); $stmt->bindParam(':password', $pass); $stmt->bindParam(':random', $random); $stmt->bindParam(':activated', $zero); $stmt->bindParam(':regdate', $today); $stmt->bindParam(':email', $mail); $stmt->bindParam(':ip', $ip); $stmt->bindParam(':realname', $nap); $stmt->bindParam(':location', $nap); $stmt->bindParam(':steam', $nap); $stmt->bindParam(':twitter', $nap); $stmt->bindParam(':about', $nap); $stmt->bindParam(':youtube', $nap); $stmt->bindParam(':banned', $zero); $stmt->bindParam(':bannedreason', $nap); $stmt->bindParam(':acticationkey', $activate); $user = $_POST['user']; $pass = $_POST['pass']; //$pass = hash('sha512',$_POST['pass']); $random = $codegen1; $today = date("m/d/y"); $mail = $_POST['mail']; $ip = $_SERVER['REMOTE_ADDR']; $nap = "n/a"; $activate = $codegen; $zero = "0"; $stmt->execute();[/php] [/QUOTE] PHP is a lovely language. :frog: [editline]June 8, 2011[/editline] Benji King
I'm coding a lot of javascript, and I'm using [url]http://www.jetbrains.com/webstorm/[/url] It works pretty good for me but wanted to get the opinions of others before settling on it. Any good?
[QUOTE=garry;30325865]I'm coding a lot of javascript, and I'm using [url]http://www.jetbrains.com/editors/javascript_editor.jsp?ide=idea[/url] It works pretty good for me but wanted to get the opinions of others before settling on it. Any good?[/QUOTE] That looks fairly nice. You might want to have a look at using Visual Studio for web development too. VS2010 has [i]really[/i] nice HTML/CSS/JS intellisense
Has anyone used CodeIgniter? I'm liking it so far but the view system is odd.. can you not have views rendered inside views? It'd be nice to be able to wrap all the header/footer fluff that's on every page in a single file so I can focus on writing views for content.
[QUOTE=Catdaemon;30332399]Has anyone used CodeIgniter? I'm liking it so far but the view system is odd.. can you not have views rendered inside views? It'd be nice to be able to wrap all the header/footer fluff that's on every page in a single file so I can focus on writing views for content.[/QUOTE] From what I gathered through my quick googling, CI doesn't seem to have a native implementation of layouts/wrappers/watchamacallits, which is awkward. You can always render the inner body to a parameter (by passing [B]true[/B] as the second argument in the render function, which makes it return a string instead of writing to the output buffer), and then rendering the layout view with this parameter, but that can probably get pretty repetetive pretty fast. FuelPHP handles this with a Controller_Template class that comes pre-loaded with a view object and some access methods for it. It's also similar to what I've done with dirp ( $this->master()->title = 'Title for the layout!' ) [URL="http://codeigniter.com/forums/viewthread/57902/"]This guy[/URL] seems to have written a solution to streamline the process, but it still feels somewhat clunky. Disclaimer: I've never touched CI in my entire life.
[QUOTE=StinkyJoe;30332594]From what I gathered through my quick googling, CI doesn't seem to have a native implementation of layouts/wrappers/watchamacallits, which is awkward. You can always render the inner body to a parameter (by passing [B]true[/B] as the second argument in the render function, which makes it return a string instead of writing to the output buffer), and then rendering the layout view with this parameter, but that can probably get pretty repetetive pretty fast. FuelPHP handles this with a Controller_Template class that comes pre-loaded with a view object and some access methods for it. It's also similar to what I've done with dirp ( $this->master()->title = 'Title for the layout!' ) [URL="http://codeigniter.com/forums/viewthread/57902/"]This guy[/URL] seems to have wrote a solution to streamline the process, but it still feels somewhat clunky. Disclaimer: I've never touched CI in my entire life.[/QUOTE] Found [url=http://codeigniter.com/wiki/layout_library/]this[/url] via your link which seems to do the job, thanks!
[QUOTE=garychencool;30309847]so like I'm working on my summative and I need help on getting this banner to stay in the text box regardless of the zoom/size of the browser. [IMG]http://i.imgur.com/tRwZC.png[/IMG][/QUOTE] Well, that's kinda obvious. If you want it to stay in place regardless of the window size, then don't rely on it. Place the banner/image properly and don't use the "position" properties.
[QUOTE=SkyCommander;30333051]Well, that's kinda obvious. If you want it to stay in place regardless of the window size, then don't rely on it. Place the banner/image properly and don't use the "position" properties.[/QUOTE] I later found out that it was out of the frame and paragraph params so that's why it blew up past. Plus, i was inserted/formated that pic on a widescreen rather than the 4:3 monitor i used to take this picture.
Who was the guy who had the database of US city data? I'd like to know where he got it.
I'm working on a web based application for my Dad's office for them to track work orders, inventories, and such because they were using an Access database and all four revisions of it are horrendous, not to mention that only one person would be able to use it at a time, and it kept corrupting itself, and before that, like 3 binders, each many inches thick. But it gets worse: the warehouse guy tried making an inventory list this week with Excel (even after Dad told him that'd be a terrible idea), so he tried making it with a [i]flip-book maker[/i]. So I think I've got everything good, but I've still got a few questions and would like some tips if I'm doing something completely wrong. [list=1] [*]First, is this a good design? I'm pretty sure that it's fine. [img]http://costeira.com/wo_layout.png[/img] [*]Since it'll be in a business, it'd require a MySQL server license. I looked and saw that both MySQL and MS SQL (they use Windows servers, so I looked about this, too) are about $4,000 per year, and I was wondering if other databases like MongoDB, Firebird, PostgreSQL, or any others would be better for this. I've only played with MySQL, so I don't know all their pros and cons. [b]Edit:[/b] Dad just came home as I was writing this (Facepunch wasn't letting me post for like 20 minutes, kept timing out) and I asked him if they already had a MySQL/MSSQL license and they do, so I'll probably be using that unless anyone knows anything better. [/list] Thanks!
[QUOTE=cas97;30336839]snip[/QUOTE] So... a method to track information? What's wrong with MySQL?
[QUOTE=cas97;30336839]I'm working on a web based application for my Dad's office for them to track work orders, inventories, and such because they were using an Access database and all four revisions of it are horrendous, not to mention that only one person would be able to use it at a time, and it kept corrupting itself, and before that, like 3 binders, each many inches thick. But it gets worse: the warehouse guy tried making an inventory list this week with Excel (even after Dad told him that'd be a terrible idea), so he tried making it with a [i]flip-book maker[/i]. So I think I've got everything good, but I've still got a few questions and would like some tips if I'm doing something completely wrong. [list=1] [*]First, is this a good design? I'm pretty sure that it's fine. [img]http://costeira.com/wo_layout.png[/img] [*]Since it'll be in a business, it'd require a MySQL server license. I looked and saw that both MySQL and MS SQL (they use Windows servers, so I looked about this, too) are about $4,000 per year, and I was wondering if other databases like MongoDB, Firebird, PostgreSQL, or any others would be better for this. I've only played with MySQL, so I don't know all their pros and cons. [b]Edit:[/b] Dad just came home as I was writing this (Facepunch wasn't letting me post for like 20 minutes, kept timing out) and I asked him if they already had a MySQL/MSSQL license and they do, so I'll probably be using that unless anyone knows anything better. [/list] Thanks![/QUOTE] Err, MySQL is open source and GPL. [url]http://www.xaprb.com/blog/2009/02/17/when-are-you-required-to-have-a-commercial-mysql-license/[/url]
[QUOTE=20 Smartness;30336042]Who was the guy who had the database of US city data? I'd like to know where he got it.[/QUOTE] [url]http://www.scrapingweb.com/[/url] :)
[QUOTE=20 Smartness;30337948]Err, MySQL is open source and GPL. [url]http://www.xaprb.com/blog/2009/02/17/when-are-you-required-to-have-a-commercial-mysql-license/[/url][/QUOTE] Maybe I'm reading everything wrong, but unless it's personal use, I'd have to get one of the business editions because it'll be in a business. [url]http://www.mysql.com/products/[/url]
For my site, I've only been using Chrome right now and I thought I would look at it with firefox and IE, but they seem to look all wrong. Firefox has all these useless layers of text that screws the text and IE just doesn't tilt at all. Is there a fix for this or should I use images?
[QUOTE=cas97;30339219]Maybe I'm reading everything wrong, but unless it's personal use, I'd have to get one of the business editions because it'll be in a business. [url]http://www.mysql.com/products/[/url][/QUOTE] [quote=mysql.com] Q3: As a commercial OEM, ISV or VAR, when should I purchase a commercial license for MySQL software? A: OEMs, ISVs and VARs that want the benefits of embedding commercial binaries of MySQL software in their commercial applications but do not want to be subject to the GPL and do not want to release the source code for their proprietary applications should purchase a commercial license from Oracle. Purchasing a commercial license means that the GPL does not apply, and a commercial license includes the assurances that distributors typically find in commercial distribution agreements. [/quote] It seems you only have to buy a commercial license if you're planning on embedding it.
[img]http://cl.ly/1y2a1m2W331e3v2P1D0K/id.PNG[/img] IE...:frog: [editline]9th June 2011[/editline] Looking for alternative way?...
[QUOTE=20 Smartness;30339471]It seems you only have to buy a commercial license if you're planning on embedding it.[/QUOTE] I think I understand now. So if I wanted to have, say, the MySQL server included with software that gets sold, then I would have to get a commercial license. Well, I remember trying to find out how much it would be and people asked before, but no one could read their legal/pricing well. Thanks for the help.
[QUOTE=zzlawlzz;30340483][img]http://cl.ly/1y2a1m2W331e3v2P1D0K/id.PNG[/img] IE...:frog: [editline]9th June 2011[/editline] Looking for alternative way?...[/QUOTE] Get rid of the filter, and use only -ms-tranform.
[QUOTE=garry;30325865]I'm coding a lot of javascript, and I'm using [url]http://www.jetbrains.com/webstorm/[/url] It works pretty good for me but wanted to get the opinions of others before settling on it. Any good?[/QUOTE] Get PhpStorm which is WebStorm plus PHP.
Sorry, you need to Log In to post a reply to this thread.