Jump to content

hoachen

Members
  • Posts

    48
  • Joined

  • Last visited

hoachen's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. my problem is i only have one textfield how can i use $_post['state']? for second field.
  2. I am doing a dataabse search on my website, but it seems like the code that i have is not practical. Would someone give me some advice. My goal is when the user type in anything(at least two alpha because they search my state like "MO") and search on the database for every columns that match what ever they want to search especially the city and state the user put in. My question is how to the query know which column to look for if they type in city or state? Are they anyway to do this? <form action="result.php" method="post"> Enter Search:<br> <input name="city" type=text> <br> <input type=submit value="Search"> </form><? $city =$_POST['city'];echo 'this is city'.$city."<br />"; $query="select * from tblinfo where city like \"city\" OR state LIKE \"city\" OR Comments LIKE \"city\" "; $result = mysql_query($query);echo $query."<br /><br />";while ($row = mysql_fetch_assoc($result)) { echo "<b>"."City: "."</b>".stripslashes($row["city"]); echo " "; echo "<b>"."State: "."</b>". stripslashes($row["state"]); echo "<br />"; echo "<b>"."Complaints: "."</b>". "<i>". stripslashes($row["complaints"])."</i>"; echo "<br /><br /><br />"; }?>
  3. Hi guys is me again. This time i really can't figure out how to display the article in details according to the 'id' assigned on database. I have a page that will display all the results with the status of 'approval' and this page only display partial details for each article (this page is working fine). If the user would like to read more about this article they will click on "View More" link and open a new windows that will display the detail according to which article they click on. Right now, on the browser, the id is correctly diplay but it display all the articles include not the id that they select.What wrong on the below code? Your advise is appreciate.$objData = new PReport($db);$id = $_GET['id'];$sWhere = "WHERE id = '$id'";$objDataload(false, false, $sWhere);<?php while ($res = $objData->fetch()) { $app=$res->getStatus(); if($app =='pending' || $app=='cancelled') { echo ''; } else { ?> <tr> <td class="txtRegular" style="border-bottom:#999999 solid 1px"><?php echo " ". $res->getID(); ?></td> <td height="36" class="txtRegular" style="border-bottom:#999999 solid 1px"><?php echo " ". $res->getDate(); ?></td> <td style="border-bottom:#999999 solid 1px" class="txtRegular"><?php echo " ". $res->getCity();?></td> <td style="border-bottom:#999999 solid 1px" class="txtRegular"><?php echo " ". $res->getState();?></td> <td style="border-bottom:#999999 solid 1px" class="txtRegular"><?php echo " ". $res->getDetails();?> </td></tr> <?php } } ?>
  4. i got it!... thanks guys
  5. Hello, guys. I have trouble to find any example that used class to display limited character. They wayI would like to do is the article will pull from database and will show only 50 character and the rest will display on new page when they click on "View More". How can i make this work using class object?Here is what use on my codewhile ($res = $objIData->fetch()) { $app=$res->getStatus(); if($app =='pending' || $app=='cancelled') { echo ''; } else { ?> <tr><td> <?php echo $res->getData();?> <?php echo $res->getDate();?> <?php echo $res->getState(); ?> </td></tr>
  6. Hello, guys. I have trouble to find any example that used class to display limited character. They wayI would like to do is the article will pull from database and will show only 50 character and the rest will display on new page when they click on "View More". Here is what use on my codewhile ($res = $objIData->fetch()) { $app=$res->getStatus(); if($app =='pending' || $app=='cancelled') { echo ''; } else { ?> <?php echo " ". $res->getData();?>
  7. hoachen

    fetch array

    I see, thanks for you sharpe spot. I got it works now. THanks
  8. hoachen

    fetch array

    Hi guys, I need some help with you. I try to echo the data from the database but i have to check one specific column(status). If that column contain 'pending' or 'cancelled' then this rows will not be echo else echo all the data. Here is what i have try but it echo everything outwhile ($mod = $objIncident->fetch()) { $showstat = $data->getStatus(); if ($showstat != "pending" || $showstat != "cancelled" ) { echo $data->getName(); echo $data->getCity(); echo $data->getComplaints(); } else { echo ''; }
  9. hoachen

    time converstion

    I just can't get this to work!!! Please somebody help!I want to get this time convert them from 7:30 pm to 19:30:00 or 7:30 am to 07:30:00 This time is manually type in because it is a time for appointment schedule so i can't use now() $startdt = $_POST['StartDate']." ".$_POST['StartTime']. " " . $_POST['sampm'];
  10. i am working on css background and come across the screen resolution problem. RIght now my css background image have a fix width and height so if 15" screen the background image will display fit into the screen but when a 18"screen monitor, it will have lot of margin at left and right. My question is how can i make it fit into any screen that will depends on the user monitor screen?Please advice and will appreciate your time and precious advice.Cheers,hoachen
  11. Thanks you for you solution, but it does not look good though, the bottom image like stretch. Any other solutions?
  12. Please see the below url of what i post earlier.The background image of the contents is not all the way down to the bottom of the article. The background image is fix 800px X 600px if the contents more than 600px height it will be look like what i have which i don;'t want to be. I want the background is same height with the article.http://www.hoachen.com.websitetestlink.com/test.html
  13. thank you for your advise.The background-position will do the position but not fix the problem i have.
  14. Thank you very much for trying to help me to solve my problem.I tried and it works for the body.But, I have a grey color for my body so it does not work on the belowbody { background-image: url('images/index_17.jpg'); background-repeat: no-repeat; background-attachment: fixed;}I tried to put this gradient background inside the wrapper and it does not work even though i put the background-attachment:fixed. It will scoll the whole page.do you have any suggestion?
  15. I am stuck on working replace a string text. I want to find all the files that contain extension of jpg and jpeg and then replace them without the extension but the filename will remain and echo out the filename without extension.I tried the below but not working!! Please help me to resolve this.$str = /.*\(.gif|jpg|jpeg) //find all the files that have the jpg, jpeg, gif extension on a "image" folder$text = preg_replace(/.$,$str)print_r($text);?>cheerhoachen
×
×
  • Create New...