- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 44
- Posts with Upvotes
- 42
- Upvoting Members
- 30
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Database Administrator. Web and database development professional. MCP: Microsoft Certified IT Professional: Database Administrator. Microsoft Certified Technology Specialist: SQL Server 2005.
- Interests
- rock music, web development, and databases
Re: Hello, I use [URL="http://www.phpclasses.org/browse/file/919.html"]class.phpmailer.php[/URL]. It works for Yahoo, Hotmail, GMail, and I'm sure many others that I haven't tested. It also includes an example which is easy to follow. | |
Re: Here's a function I use sometimes. It explodes the address to get the domain name. It then checks for a Mail Exchange on the domain. This will work for bogus domain names but won't do anything for email addresses like [icode]bill@hotmail.com[/icode] or [icode]suzie@yahoo.com[/icode]. Try to keep in mind, there is … | |
Re: JavaScript comes pre-installed on the browser. PHP does not. | |
Re: Use Sessions for authentication. They will log the user off when the browser is closed. You shouldn't need to store a value in the db unless you want to show users activity (last login at...) | |
Re: I guess you mean this: [icode] <a href="http://www.google.com"> <img src="<?php echo get_bloginfo('url') ?>/serv67/cmg2/img/blog2.jpg" alt="pic" /> </a>[/icode] | |
Re: In order to submit variables to the second page, you'll have to find a way to get them inside of the form on the first page. On the first page, your form is empty, i.e. no variables actually make it in between the <form> and </form> tags. Use your loop … | |
Re: Not sure about the unique part, as a unique constraint will only support one null value in the column. It sounds like you potentially could have many. Use a check constraint to verify both aren't null: [code] ALTER TABLE TableA ADD CONSTRAINT CK_BothDepartsNotNull CHECK (departA IS NOT NULL OR departB … | |
Re: There are several ways to do this. Fortunately you at least have a primary key. Be smart and backup the database before attempting. Here's an example solution using a CTE: Create the test tables and populate: CREATE TABLE PassportTest( Id int not null ,Name varchar(25) not null ,IdentityNo1 char(5) null … | |
Re: The master database has a scalar function, fn_varbintohexstr, for this. Example: DECLARE @text varchar(256), @varbinary varbinary(256); SET @text = 'A1B2C3'; SET @varbinary = cast(@text as varbinary(256)); SELECT @text OriginalString , sys.fn_varbintohexstr(@varbinary) HexString /* returns nvarchar(max)*/ | |
Re: It's not pretty nor creative but is Valid XHTML 1.0 Strict: [code=html] <ol> <li style="font-size:24px"> <span style="font-size:12px">This text is 12px. The bullet number is 24px.</span> </li> <li> <span style="font-size:12px">This text is 12px. The bullet number is 12px.</span> </li> </ol> [/code] | |
| |
Re: This is pretty common for programmers new to php. We'll need to see more code. Are you using echo or print before the header? [URL="http://www.tech-recipes.com/php_programming_tips1489.html"]Here's[/URL] an article about the error. | |
Re: This article was written in 2007 but still applies: http://www.search-this.com/2007/03/12/no-margin-for-error/ Priceless information for anyone in CSS hell. | |
Re: Yeah, you probably don't want to limit yourself to web development. Either stick with CS or find something that involves security. My school had an Master in Information Systems and E-Commerce degree that was pretty close to what your looking for. | |
Re: JavaScript is executed by the browser on your local machine. JSP is executed by the server which hosts the site. So when you visit a page written in jsp, the server executes the jsp and then delivers the page across the internet connection to your browser. If any JavaScript is … | |
Re: Use the bit datatype for boolean. Valid values are 0 or 1. In the below example, Active is the bit column with a default value of 1 (true). [code=sql] CREATE TABLE ActiveUsers (UserId int NOT NULL, Active bit NOT NULL default 1) /*Register User*/ INSERT ActiveUsers (UserId) VALUES (123) --Whatever … | |
Re: I'm assuming by menu, that you mean a drop-down menu populated from a web application. Being a programmer, you'll have the tendency to perform iterations over result sets. This will perform very poorly when your row count gets higher. Save the iterations for after the db gives you back the … | |
Re: You can output to excel using OPENROWSET or bcp (with xp_cmdshell). | |
Re: Try this. I haven't tested it but it should do the trick. The key is to use the @ sign on line 2 to prevent the error message from showing up on the clients browser. Also, if you add or die(mysql_error()) to the end of line 2, the script will … | |
Re: Photoshop is the industry leader in photo editing. It's the program that almost every professional photographer uses. It's also great for editing images and exporting to the web. However, if you are looking to become a better web designer, you may find that Adobe Fireworks is what you are looking … | |
Re: An easy way to create an xls file from php is to create a tab delimited file with an xls extension. Here's an easy example. Create a folder named files and save the following php file in the same directory as the folder. [code=php]<?php $file="files/test.xls"; $f = fopen($file, "w+"); fwrite($f,"A1\tB1\t\nA2\tB2\tC2\t\n\t\tC3"); … | |
Re: Try modifying the following to pull from the table, rather than comparing the date variables: [code] DECLARE @intime DATETIME DECLARE @outime DATETIME DECLARE @time int--total seconds DECLARE @days int, @hours tinyint, @minutes tinyint, @seconds tinyint SET @intime = GETDATE() SET @outime = DATEADD(S, 3663, @intime) SET @time = DATEDIFF(S,@intime,@outime) SET … | |
Re: urtivedi has given you 2 good examples that will work. In SQL Server 2008, there's a 3rd option which utilizes the new [B]date[/B] datatype: [code] SELECT * from tablename where CAST(starttime AS date) = CAST(endtime AS date) [/code] [url]http://msdn.microsoft.com/en-us/library/ms186724.aspx#DateandTimeDataTypes[/url] | |
Re: What is the point of the routesequence?? You're just storing the same value twice... Also, each row should be unique, whether it be an identity on the id or a composite value. Rows 1 & 2 are duplicates, as are 6 & 7. This design violates first normal form, will … | |
Re: Post your connection string | |
Re: Here's a simple example of how to use output variables in stored procedures: [code] CREATE PROC dbo.ReturnString @string VARCHAR(500) ,@outputString VARCHAR(500) OUTPUT AS SET @outputString = @string GO [/code] Then to call the stored procedure, you'll want to declare a variable and assign the value like so: [code] DECLARE @output … | |
Re: This will work with 2008. With 2005 or earlier, you'll need to use datetime and the convert to varchar to strip the time portion off. [code] DECLARE @yesterday DATE SET @yesterday = DATEADD(D,-1,GETDATE()) [/code] | |
Re: You can't insert into 2 tables with one statement. You can grab the identity of the parent table and insert into the child table with 2 statements: [code] DECLARE @AppValId int INSERT Products (Item) VALUES ('Pepsi') SET @AppValId = @@IDENTITY INSERT ProductAttributes (ApplicationValueID,Attribute,Value) VALUES (@AppValId,'Price','2.99') [/code] | |
Re: Your subquery is returning multiple rows. This could be fixed with a join: [code] update ML set ML.rptprobtype = MD.[Problem Type] FROM tbl_M_MasterLogs ML JOIN tbl_rpt_MasterData MD ON ML.CaseNo = MD.CaseNo [/code] | |
Re: If your SQL Server is 2005 or greater, you can use EXCEPT and INTERSECT to find these. List email addresses that are in both Table1 and Table2: [code] SELECT email FROM Table1 INTERSECT SELECT email FROM Table2 [/code] List email addresses that are in Table1 but not in Table2: [code] … |