Jump to content

dennismonsewicz

Members
  • Posts

    1,136
  • Joined

  • Last visited

Everything posted by dennismonsewicz

  1. the one that does not is the google one. I took it out and it works fine. How would I be able to search this DB table as well while still searching through all of the other DB tables?
  2. here ya go (with the added return key): $query = "(select * from arcamax where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from drudge where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from google where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from human_events where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from newsmax where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from street where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from townhall where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union ( select * from weatherbug where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from worldnet where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") order by mailedlist";
  3. Ok.... I have written a PHP search App and I want it to search between like 8 or so tables in one Database. Here is my union mysql code: $query = "(select * from arcamax where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from drudge where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from google where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from human_events where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from newsmax where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from street where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from townhall where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from weatherbug where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from worldnet where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") order by mailedlist"; Now if I run a search with the above code it does not work...but if I limit the number of tables to two it works fine. Any suggestions?
  4. here is my union statment: $query = "(select * from arcamax where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from drudge where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from google where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from human_events where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from newsmax where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from street where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from townhall where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from weatherbug where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\") union (select * from worldnet where promo_code like \"%$trimmed%\" or start_end_date like \"%$trimmed%\" or mailedlist like \"%$trimmed%\" or description like \"%$trimmed%\" or orders like \"%$trimmed%\" or totalrevenue like \"%$trimmed%\")";
  5. I am doing a text search and the PHP code that processes the SQL command searches two database tables using the union command. I was wondering if there is a way to add a third, fourth, fifth, and so on. Right now if I add any more the application breaks. Any ideas?
  6. I am trying to do a search and I was wondering if there is a way to search two ore more DB tables? Right now I am search two using the union command but when I add a third it breaks. Any ideas?
  7. Sorry it took me so long to get back with you....I had to leave the office cause my head was hurting yesterday after looking at so much code. LOL
  8. Also does $_GET['table'] pull all the names of the tables or do i need to replace it with something?
  9. Howdy, I follow all of your code up to this part: $bHdrs = false; while($row = mysql_fetch_assoc($q)){ // This IF will print the table headers on the first row encountered if(!bHdrs){ $bHdrs = true; $tmp = Array(); foreach($row as $k => $v){ $tmp[] = $k; } echo '<tr><td>' . implode('</td><td>', $tmp) . '</td></tr>'; } echo '<tr><td>' . implode('</td><td>', $row) . '</td></tr>'; what is the bHdrs variable used for? what does the implode function do? and what is the $tmp variable for? Sorry If I sound like a complete idiot...I am still learning. I just learned how to do a full text search yesterday. So I am trying to ask as many questions as possible Thanks, Dennis
  10. Hey bud, try this site... http://www.tizag.com/phpT/filewrite.php Hope this helps, Dennis
  11. Is the form action directed to the same page or a different page? And what do you mean apache crashes?
  12. Hello, My question is a little complicated to ask so I will try to ask it to make as much sense as possible LOL. OK here goes... In querying a regular DB you use the following code: $query = "SELECT * FROM table_name"; Well I want to be able to do something like this: $query = "SELECT * FROM database_name"; Here is my reasoning: I have built and intranet for the company I work for. I have imported all of the data requested from an Excel Spreadsheet into the corresponding SQL tables. Now for the page I am wanting to pull off my weird select db_name code works like this: I want to be able to go there and display the Table names within that DB and when a user clicks on one of the links it will reload the page displaying the results for the corresponding Table. Make sense? Thanks for all help, Dennis PS - I am using MySQL. Oh and if you want to contact me directly PLEASE email me at dennismonsewicz@gmail.com
  13. Last night I created a login and logout script for a website. Here is a short version of the long story: When I first developed the site we had tons of permission problems. It was asking for windows authentication when trying to view the site. Well for a temporary fix we set up a temporary user. Well I finally got around to creating the login/logout script and in the event of having both the windows authentication and the PHP login, everything worked fine. Well I told the IT guy that we need to get rid of the Windows authentication. So he created another user outside of the anonymous web user (IUSR) windows likes to use for anonymous web access through IIS. Well that screwed up everything. PHPmyadmin had a hissy fit with PHP files erroring out with the error of no input file specified and the login page for the website kept refreshing itself instead of doing the set action specified by the HTML. Well now I finally got it to stop asking for windows authentication. But no session is started now. I can physically logout by going to the logout page and physically log back in, but this only happens when I go to the actual URL of the login page. Below is the code being used to start the session: session_start(); if(!session_is_registered(username)){ header("location:login/index.php"); } The session does not happen and totally ignores itself and loads the site anyways. Any help with this will be greatly appreciated. -Dennis
  14. Ok... I have been battling this for a while now. I am running PHP 5 and MySQL 5 on an IIS server (I know, I know Laugh it up), but when you go to the website it asks for windows authentication. For a quick fix the IT guy and me set up a user so people can view the website as the development happens. Now I have created a Secure PHP login for the site all together and cannot get rid of the Windows Authentication. how in the world do I do that in IIS? Any help is greatly appreciated, -Dennis
  15. PROBLEMED SOLVED! I forgot to add the db_login.php to the includes folder! LOL! Thanks for your help bud!
  16. <?php ob_start(); include "includes/db_login.php"; // username and password sent from signup form $username = $_POST['username']; $password = md5($_POST['password']); $sql="SELECT * FROM users WHERE username='$username' and password='$password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $username and $password, table row must be 1 row if($count==1){ // Register $username, $password and redirect to file "login_success.php" session_register("username"); session_register("password"); header("location:http://intranet.healthresources.net/index.php"); } else { include "includes/header.php"; echo "<p>Wrong Username or Password</p>"; include "includes/footer.php"; } ob_end_flush(); ?> Above is the new code you suggested using the md5 hashing
  17. I tried everything you suggested. I am using md5 hashing for my passwords. I tried printing out $result and got nothing and I tried printing out $count and got nothing. I then tried printing out $username and the username is being passed
  18. <?php ob_start(); include "includes/db_login.php"; // username and password sent from signup form $username=$_POST['username']; $password=$_POST['password']; $sql="SELECT * FROM users WHERE username='" . $username . "' and password='" . $password . "'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $username and $password, table row must be 1 row if($count==1){ // Register $username, $password and redirect to file "login_success.php" session_register("username"); session_register("password"); header("location:../index.php"); } else { include "includes/header.php"; echo "<p>Wrong Username or Password</p>"; include "includes/footer.php"; } ob_end_flush(); ?> I am using the above code to check when a user tries to login to the company intranet. But when a username and password is given I receive the else printed statement, "Wrong Username or Password". I know the connection information to the database is correct, I have no idea why it is doing. NEED HELP FAST! All help is appreciated. Thanks, Dennis
  19. ok... I got the delete command working, but I am still having problems trying to get the edit commands working properly
  20. Ok... That didn't work. When I replaced it with a 1, the edit field values disappeared and nothing was being pulled out of the database.
  21. I did what you suggested and got the following error: Could not query the database: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11 This occurred when trying to edit.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.