Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. can you post your column names from the spl table?
  2. try this and see what happens: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modify DataBase</title> <style type="text/css"> <!-- body { background-color: #D6D6D6; } body,td,th { color: #000; } --> </style></head> <body> <p> <?php include("config.php"); // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Retrieve data from database $search=$_POST['search']; if ($search == '' || $search == ' '){ echo "Search Variable empty or not passed corectly - variable is empty!"; die; } else{ // 1st query $sql="select orsku from spl WHERE orsku LIKE '%".mysql_real_escape_string($search)."%' LIMIT 1"; $result=mysql_query($sql) or die (mysql_error()); $rows=mysql_fetch_array($result); $passon=$rows['orsku']; //2nd $sql1="select * from dsgi WHERE reconsku LIKE ($passon)"; $result1=mysql_query($sql1) or die (mysql_error()); // Start looping rows in mysql database. } ?> </p> <p> </p> <form method="post" action="join.php"> <table width=233 align=center> <tr> <td width="88">Search for:</td><td width="133"><input type="text" name="search" size=20 maxlength=255></td></tr> <td></td><td><input type=submit></td></tr> </table> <p> </p> </form> <table width="800" height="72" border="1" align="center" cellpadding="3" cellspacing="0"> <tr> <td width="113" align="center"><strong>Orig SKU</strong></td> <td width="66" align="center"><strong>Recon SKU</strong></td> <td width="90" align="center"><strong>Make</strong></td> <td width="169" align="center"><strong>Model</strong></td> <td width="58" align="center"><strong>Working</strong></td> <td width="161" align="center"><strong>Actions</strong></td> </tr> <?php while($rows=mysql_fetch_array($result1)){ echo "<tr><td>".$rows['origsku']."</td><td>".$rows['reconsku']."</td><td>".$rows['make']."</td><td>".$rows['model']."</td><td>".$rows['working']"</td><td>". $rows['actions'].'</td><td width="41" align="center"><a href="update.php?id='.$rows['id'].'>update</a></td><td width="36" align="center"><a href="delete_ac.php?id='.$rows['id'].'>delete</a></td></tr>'; } ?> </table> </body> </html> all I have done is basicly put a very very simple validation escape in there that checks the $_POST is assigning a real value to the $search variable, and stripped out the line assigning the % marks to $search as it's now included in the query. (changed the format of the output table code a little bit and removed query from query$sql1 on line 47. let me know what you get back from this.
  3. your question seems to be one of SQL rather than one of php, the SQL you are looking for should be somthing like: $query = "SELECT * from `tablename` MATCH (`columnName1`, `columnName2`, `columnName3`...) AGAINST (`keyword` WITH QUERY EXPANSION)"; $result = mysql_query($query) or die (mysql_error); while ($row = mysql_fetch_array($result)){ print_r ($row); } does that help?
  4. You could do it by including a hidden field in your form, <input type="hidden" name="control" value="true" /> Then... On your page that you want to be able to refresh, include <?php //any headers or session_start() statements that you have go here. if(isset($_POST['control'])){ //The Rest Of Your Current Page Code Goes Here unset($_POST['control]); } else{ //only the part of your code that displays the page info, not the part that processes the form gets repeated in here } ?> And see how that goes.
  5. OK, two things - 1. Please stop selecting * from your databases when you only want 1 field - it's just wrong. 2. your LIKE statement is missing operators, which you would have known if you had escaped your mysql_error() to screen. Fix with this: $sql="select orsku from spl WHERE orsku LIKE '%".$srch."%' LIMIT 1"; $result=mysql_query($sql) or die (mysql_error()); $rows=mysql_fetch_array($result); $passon=$rows['orsku']; //2nd query $sql1="select * from dsgi WHERE reconsku LIKE ($passon)"; $result1=mysql_query($sql1) or die (mysql_error()); while($rows=mysql_fetch_array($result1)){ } see how that goes.
  6. Can you elaborate on what a "Full Text MySQL Table" is please?
  7. erm...not for testing you don't. Just stick your connection string at the top of the code I gave you mysql_connect("localhost", "root", ""); so it looks like this: <?php mysql_connect("localhost", "root", ""); mysql_select_db("adatok") or die ("<p>Nincs letrehozva az adatbazis!</p>"); mysql_query(" CREATE TABLE `felhasznalo` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT , `nev` VARCHAR( 10 ) NOT NULL , `jelszo` VARCHAR( 10 ) NOT NULL , `szulev` YEAR NOT NULL , `nem` CHAR( 1 ) NOT NULL , `hobbi` VARCHAR( 100 ) NOT NULL , `szam` INT( 2 ) NOT NULL , `szoveg` VARCHAR( 100 ) NOT NULL , PRIMARY KEY ( `id` ) )ENGINE=MyISAM DEFAULT CHARSET=utf8; ") or die (mysql_error()); ?> This way we should see if there is a problem with the create statement or if It makes the table.
  8. It would have helped if I got the quotes right aswell: <form action="commit.php?action="<?php echo $_GET['action']; ?>&type=billet" method="post"> As far as I can see the $_GET isn't looking for any of the $_POST variables, it simply looks as though it's being used to set the destination page for the form action that is using the $_POST variables, so I don't thing there will be a problem with it being used. Personaly though I would assign the $_GET to a page specific variable with validation for use in the echo statement.
  9. I thought I had hinted at that in my last sentence...
  10. Looks to me like you are using <div>'s where you should be using arrays. Try converting your code to use arrays to store the info and see how it goes.
  11. on your actual page, have you changes the re-captcha keys to valid ones?
  12. If your only using html links to other static html pages then php is not needed, and if it's not needed you shouldn't really use it - it's just over complicating things. That said it sounds to me like you want to take all this static content and condense it into one dynamic page. If that's the case then php is the tool for the job. If you are trying to make it all one dynamic page then post up your a few of your existing html page titles along with the full code for your index.php and we'll get to work.
  13. OK, your connection settings are wrong. You need to enter a valid user name and password for your database, I only coppied what you had posted, I assume you took the password out for post?
  14. That then seems to be the problem. re-run your mysql_select_db("adatok") or die ("<p>Nincs letrehozva az adatbazis!</p>"); mysql_query(" CREATE TABLE `felhasznalo` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT , `nev` VARCHAR( 10 ) NOT NULL , `jelszo` VARCHAR( 10 ) NOT NULL , `szulev` YEAR NOT NULL , `nem` CHAR( 1 ) NOT NULL , `hobbi` VARCHAR( 100 ) NOT NULL , `szam` INT( 2 ) NOT NULL , `szoveg` VARCHAR( 100 ) NOT NULL , PRIMARY KEY ( `id` ) )ENGINE=MyISAM DEFAULT CHARSET=utf8; "); with the addition of the or die (mysql_error()) before the ; on the last line and see what happens.
  15. Is there a reason why you need to post the variables through the page headers and not through $_POST or $_SESSION super globals instead?
  16. Check your table names by making a new php page and run this code on it. <?php mysql_connect("localhost", "root", ""); mysql_select_db("adatok") or die (mysql_error()); $qry = "show tables"; $result = mysql_query($qry) or die (mysql_error()); while ($row = mysql_fetch_array($result)){ echo $row[0]; } ?>
  17. $felh=mysql_fetch_row(mysql_query("select nev from felhasznalo where nev='".$_POST['user1']."'", $kapcsolat)); should read: $felh=mysql_fetch_row(mysql_query("SELECT nev FROM felhasznalo WHERE nev= '".$_POST['user1']."' AND password = '".$kapcsolat."'"));
  18. Had a look at this? http://uk.php.net/manual/en/function.date.php
  19. change <form action="commit.php?action=<?php echo $_GET['action']; ?>&type=billet" methode="post"> to this : <form action="commit.php?action="<?php echo $_GET['action']; ?>"&type=billet" method="post">
  20. What exactly do you want the select to return on the line that you were getting the error on, because your WHERE statement has thew wrong syntax.
  21. cahnge to <input name="id" id="id" type="hidden" value="<?php echo $id; ?>" />
  22. Well anyway, just scrapped IIS and installed Apache. Seems to be working now.
  23. Having a lot of trouble on this one. I have been running a WIMP server on a XP virtual machine, but having got a few more contracts on the go I thought that I would install and set up a proper server. So I installed Server 2003, set up Application Server, installed FastCGI extensions for IIS6 and got everything looking like it should. However I can not get PHP to integrate with the IIS FastCGI. I have tried using both the Zip and MSI for the V9 x86 Thread Safe and have got nothing but error after error. I have allowed all server extensions, enabled scrip write access to the webdir, associated .php with the fcgiext.dll and run the cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe" and still get the following error: FastCGI Error The FastCGI Handler was unable to process the request. Error Details: * The FastCGI process exited unexpectedly * Error Number: -2147467259 (0x80004005). * Error Description: Unspecified error HTTP Error 500 - Server Error. Internet Information Services (IIS) Anyone know what the problem is??
  24. Thanks Pikachu, for clearing that up. That proves it's time for me to clock off for the night
  25. It was just a joke dude
×
×
  • 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.