SQL db check | Unix Linux Forums | Web Programming

  Go Back    


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

SQL db check

Web Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-11-2012
graphicsman graphicsman is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 4 January 2013, 4:48 PM EST
Location: Nashville, TN
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
SQL db check

Ive debated this for awhile after I ran into a crap load of issues with my hosting's SQL server. I was curious to know if there is a way to write a db check into my .htaccess file that would verify if a connection is present and if not transfer to another domain?? I know it can be done manually in Cpanel (domain fowarding) but I would like a way for this to be into play instead of SQL errors. Ideas??
Sponsored Links
    #2  
Old 10-11-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 28 November 2014, 11:37 AM EST
Location: Saskatchewan
Posts: 19,944
Thanks: 848
Thanked 3,421 Times in 3,206 Posts
Which SQL?

But probably no. That's the sort of thing you'd do in PHP. If you can check before PHP actually outputs anything, you can dump a header() to redirect then quit if the SQL doesn't work.
Sponsored Links
    #3  
Old 10-11-2012
graphicsman graphicsman is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 4 January 2013, 4:48 PM EST
Location: Nashville, TN
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Corona688 View Post
Which SQL?

But probably no. That's the sort of thing you'd do in PHP. If you can check before PHP actually outputs anything, you can dump a header() to redirect then quit if the SQL doesn't work.
I actually found something like that written in PHP but i didnt like how it required you to enter the db name, password, and user. I thought that would be a major security risk.

It was here
    #4  
Old 10-11-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 28 November 2014, 11:37 AM EST
Location: Saskatchewan
Posts: 19,944
Thanks: 848
Thanked 3,421 Times in 3,206 Posts
Yes, that one would be.

Hardcode your own simple one with fixed connection details and it won't be vulnerable to injection.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl code to check date and check files in particular dir ajaypatil_am Shell Programming and Scripting 1 07-05-2012 09:29 AM
check in and check out comments saku Shell Programming and Scripting 0 02-08-2012 03:00 AM
Check EOF char in Unix. OR To check file has been received completely from a remote system alexalex1 UNIX for Advanced & Expert Users 5 07-22-2010 08:48 PM
script to check if another script is running and if so, then sleep for sometime and check again mathews Shell Programming and Scripting 2 07-22-2010 12:25 AM
Script to check for a file, check for 2hrs. then quit mmarsh UNIX for Dummies Questions & Answers 2 09-16-2005 03:46 PM



All times are GMT -4. The time now is 04:25 PM.