Displaying and echo in the body

i have the echo no results being displayed but when its run  it currently displays at the top of the page
if(count($results) > 0){
         echo implode($results);
     else {
         echo "No results were found.";
how do i show the No results were found. in the contents
thanks in advance

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
}if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
if (isset($_POST['userid'])) {
  $loginUsername=$_POST['userid'];
  $password=$_POST['password'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "signup/signup-complete.php";
  $MM_redirectLoginFailed = "failed.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_hostprop, $hostprop);
  $LoginRS__query=sprintf("SELECT userid, password FROM think_signup WHERE userid=%s AND password=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
  $LoginRS = mysql_query($LoginRS__query, $hostprop) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
          if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;               
    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
    header("Location: " . $MM_redirectLoginSuccess );
  else {
    header("Location: ". $MM_redirectLoginFailed );
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  return $theValue;
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 5;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$var_SalaryReq_Recordset1 = "xxxxx";
if (isset($_GET['SalaryReq'])) {
  $var_SalaryReq_Recordset1 = $_GET['SalaryReq'];
$var_skills_offered_Recordset1 = "xxxxx";
if (isset($_GET['skills_offered'])) {
  $var_skills_offered_Recordset1 = $_GET['skills_offered'];
$var_location_Recordset1 = "xxxxx";
if (isset($_GET['location'])) {
  $var_location_Recordset1 = $_GET['location'];
$var_PositionReq_Recordset1 = "xxxxx";
if (isset($_GET['PositionReq'])) {
  $var_PositionReq_Recordset1 = $_GET['PositionReq'];
mysql_select_db($database_hostprop, $hostprop);
$query_Recordset1 = sprintf("SELECT ID, userid, FirstName, Surname, SalaryReq, PositionReq, location, otherComments, skills_offered FROM think_signup WHERE SalaryReq LIKE %s OR PositionReq LIKE %s OR location LIKE %s OR skills_offered LIKE %s", GetSQLValueString("%" . $var_SalaryReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_PositionReq_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_location_Recordset1 . "%", "text"),GetSQLValueString("%" . $var_skills_offered_Recordset1 . "%", "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $hostprop) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordset1") == false &&
        stristr($param, "totalRows_Recordset1") == false) {
      array_push($newParams, $param);
  if (count($newParams) != 0) {
    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
BODY HERE
<div id="CandidateSearchResCont">
        <?php
        $noresults = "No results were found!";
if(count($results) > 0){
         echo implode($results);
     else {
         echo "<p>$noresults</p>";
?>
          <?php do { ?>
            <table width="655" border="0" cellspacing="5" cellpadding="0">
              <tr>
                <td colspan="2" class="Titlegreen"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left"><a href="candidate-information.php?ID=<?php echo $row_Recordset1['ID']; ?>" class="joblinks"><?php echo $row_Recordset1['PositionReq']; ?></a></td>
                    <td> </td>
                    <td align="right"><?php echo $row_Recordset1['skills_offered']; ?></td>
                    </tr>
              </table></td>
              </tr>
              <tr>
                <td colspan="2" class="textblack"><?php echo $row_Recordset1['otherComments']; ?></td>
              </tr>
              <tr>
                <td width="250"><a href="candidate-information.php?ID=<?php echo $row_Recordset1['ID']; ?>" class="smallTXTlinksBlack">more info</a></td>
                <td width="405"><div align="right"><span class="pos_salary"></span><span class="pos_location"> <?php echo $row_Recordset1['SalaryReq']; ?>/<?php echo $row_Recordset1['location']; ?></span></div></td>
              </tr>
            </table>
            <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
          <p> 
          <table border="0">
            <tr>
              <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
                  <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>" class="smallTXTlinksBlack">First</a>
                  <?php } // Show if not first page ?></td>
              <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
                  <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>" class="smallTXTlinksBlack">Previous</a>
                  <?php } // Show if not first page ?></td>
              <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
                  <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>" class="smallTXTlinksBlack">Next</a>
                  <?php } // Show if not last page ?></td>
              <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
                  <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>" class="smallTXTlinksBlack">Last</a>
                  <?php } // Show if not last page ?></td>
            </tr>
          </table>
          </p>
        </div>

Similar Messages

  • Display 4 parameters in the body of the error message

    How do I display 4 parameters in the body of the error message when a CAPI fires?
    By default only the primary key is inculded in the body of the message generated by default for any CAPI.
    For e.g. I have an employee table with following columns:
    emp_id, dept_id, location_id.
    The employee_name, department_name and location_name is stored in 3 different table.
    Now when the Business Rule is violated, I would like the message as:
    The employee Mr. XYZ belonging to the Department ENGG and residing at the location SAN JOSE ....... <Business Rule Text>.
    Can someone help?

    Hi,
    @ kranthi.k | Rod West
    First of all, thank you very much for your inputs.
    Rod West
    Very nice article with very clear steps from LearnDiscoverer blog.
    I have followed your instructions:
    1). Created a package to enable me to set and retrieve contexts from in Discoverer
    2). Imported the set_context and show_context functions
    3). Created a calculation to call the set_context
    Unfortunately, when I run the report I did not get any result.
    As an analysis to trace the issue, I used TOAD to set the SET_CONTEXT and when I did that I ended up with the following error message:
    !http://i40.tinypic.com/1563dzn.jpg!
    Why it keeps asking me about privileges? Is there a way to avoid that please?
    Thanks in advance.
    With Regards,
    Rafeea
    Edited by: Rafea on May 19, 2009 12:43 AM

  • How do I make a photo a jpeg that can be attached to an email and not in the body

    How do I attach photos to an email so that they are an attachment and not in the body of the email?

    Right click on the photo in the email and select Display as Attachment from the contextual menu.  How it ends up is dependent on the email client.  You may have it show up as an attachmen before sending and the receiving end may be set to display it in the body.
    In either case be sure to set Mail to send Windows Friendly Attachments:
    If you compress/zip the file it before adding to the email it will definitely be added as an attachment. But that requires an couple of additonal steps and to assure the zipped file will be Windows friendly you would need to use the free YemuZip application.
    OT

  • Want to send a email with images and text in the body of email in iOS

    In iOS, we have written a code to send an email,  with embedded images and text in the body of the email ( not attachment) using mail composer. It works well with iOS devices like iPhone and iPad, but does not work in window based OS. Can anybody help. The code is

    Thanks James !, do you have an idea how to  find the window resource which I belive will be included in our appllication pack.
    In above  I have missed to copy the code,below is the code. This might help you to help me.
    NSMutableString *imgContent = [[[NSMutableString alloc] initWithString:@"<html><body>"] retain];
    UIImage *imageData = [UIImage imageNamed:@"Midhun.png"];
    NSData *imageDataInBase64 = [NSData dataWithData:UIImagePNGRepresentation(imageData)];
    NSString *base64String = [imageDataInBase64 base64EncodedString];
    [imgContent appendString:[NSString stringWithFormat:@"<p><b><img src='data:image/png;base64,%@'></b></p>",base64String]];
    [imgContent appendString:@"</body></html>"];
    MFMailComposeViewController *emailWin = [[MFMailComposeViewController alloc] init];
    [emailWin setMessageBody:imgContent isHTML:YES];

  • A document page opens that is too big for the display and runs off the end of the monitor

    How do you fix a problem where document pages open that are too big for the display and runs off the end of the monitor? The borders are off the monitor so there is no window edge to grab and adjust.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • When I try to send a link via email a lot of incoherent information comes up in the To.... box and not in the body of the email or in the Subject.........

    When I try to send a link via email a lot of incoherent information comes up in the To.... box and not in the body of the email or the Subject.

    Does this happen in Thunderbird? http://www.mozillamessaging.com/en-US/support/
    Or in a web based interface? Then check whether same happens in another browser to see whether that's a browser or website issue.

  • How do you make a photo an attachment and not in the body of the email

    How do you attach a photo as an attachment and not in the body of the email?

    If you attached the photo using the attach icon or attach command, it will act as an attachment on the recipient's end, even though you see it in Mail in the body of your message. If you drag and dropped your photo into your email, it will act as a placed graphic in the body of your message.

  • HT3775 Why won't quicktime player work? I own Mac Book Pro with Retina Display and connote get the quicktime player to open or play quicktime movies?

    Why won't quicktime player work? I own Mac Book Pro with Retina Display and connote get the quicktime player to open or play quicktime movies?

    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Preferences/com.apple.quicktimeplayer.plist. Move the .plist to your desktop.
    Open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.
    Thanks to leonie for some information contained in this.
    You might need to redo the View settings after an update.

  • When I plugged in my macbook and i touch the body then it vibrates slightly like earthing. is this common?

    when I plugged in my macbook and i touch the body then it vibrates slightly like earthing. is this common?

    Not so much.
    Take it in for free assessment, seems it could be the harddrive:
    Genius reservation http://www.apple.com/retail/geniusbar/
    on-line https://getsupport.apple.com/GetproductgroupList.action
    check warranty https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • My default search engine is Google and I deleted Bing. Whenever I open a new tab, Bing is displayed and it takes the focus so if I am trying to type a URL in the new tab, it is entered in the damn bing search box. HOW DO I GET RID OF THAT ACCURSED BING?

    My default search engine is Google and I deleted Bing from the Search Providers. Facebook is set as my home page. Whenever I open a new tab, a Bing search box is displayed on the page and it takes the focus so when I am trying to type a URL in the new tab, it is entered in the damn bing search box. HOW DO I GET RID OF THAT ACCURSED BING

    Swarnava, thank you very much! that did it and I am Bing-less . . . OH HAPPY DAY!! WOOHOO!!!! thank you, thank you, thank you!

  • TS3276 Attach a document as a file and not in the body of the email

    Good Morning from the UK!
    I have recently changed over from using MS Office for emails and onto Apple Email
    I now cannot attach documents in an email as a file
    They appear in the body of the email
    The recipient cannot view them as they are too small
    When they are then zoomed, they are too blurred to view
    I look forward to any help
    Regards
    Kim

    If you attached the photo using the attach icon or attach command, it will act as an attachment on the recipient's end, even though you see it in Mail in the body of your message. If you drag and dropped your photo into your email, it will act as a placed graphic in the body of your message.

  • Display and save only the measured FRF curve for impact test

    hi,
    Im very new to Labview. I would like to do a simple impact test using Labview.
    The frequency range of my interest is only 0-200Hz. It is mean that I could like to capture the FRF for this frequency after I excite the system.
    My question is how can I capture and display the results for FRF onyl after I excite the system.
    My current condition is when I start the measurement there is some reading (may be is noise) showing in my graph indicator (setting at 0-200Hz).
    When Im exciting the system using hammer, the curve of FRF is appear for a while and turn again into some noise reading (similar with before excitation).
    How can I let my graph indicator show and stop at the FRF curve even after excitation?
    Thanks alot^^
    Regards

    you naming convention is confussing. you should follows Java naming convention..you have a getXXX but decalred the return type as "void"...get usully means to return something...
    your code is doing too much..and hard to follows..
    1. get the selected files
    for each selected file
    process the file and return the result
    write out the result.
    /** close the precious resource */
    public void closeResource(Reader in){
        if (in != null){
            try{ in.close(); }
            catch (Exception e){}
    /** get the total number of line in a file */
    public int getLineCount(File file) throws IOException{
        BufferedReader in = null;
        int lineCount = 0;
        try{
            in = new BufferedReader(new FileReader(file));
            while ((in.readLine() != null)
                lineCount++;
            return lineCount;
        finally{ closeResource (in);  }
    /** read the file */
    public void processFile(File inFile, File outFile) throws IOException{
        BufferedReader in = null;
        StringBuffer result = new StringBuffer();
        try{
            in = new BufferedReader(new FileReader(inFile));
            String line = null;
            while ((in.readLine() != null){
                .. do something with the line
                result.append(....);
            writeToFile(outFile, result.toString());
        finally{ closeResource (in);  }
    public void writeToFile(File outFile, String result) throws IOException{
        PrintWriter out = null;
        try{
            out = new PrintWriter(new FileWriter(outFile, true));  // true for appending to the end of the file
            out.println(result);
        finally{  if (out != null){ try{ out.close(); } catch (Exception e){} }  }
    }

  • E-Mail sending with payload field in the topic and / or in the body

    Hello all,
    I have follow question:
    For a project, we need follow functionallity:
    If we get a Purchase Oder Message into the SAP XI for the customer:
    1.) XI have generating an E-Mail, which the topic contains the Order Number, or in the
    body of the E-Mail is a list which contains all Order - Numbers from the Message.
    2.) If we send the E-Mail, a attachment shouldn't be necessary.
    Can somebody help me ?
    Thanks
    Kind regards
    Stephan

    Hi,
    Check the links for Email Adapter,If u want to send the Attachment then give me ur mail id i will send you one doc which will explain u how to send Email in Attachment.
    Receiver Mail Adapter.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/community.user/blog/2006/09/07/email-reporting
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    eMail Reporting
    /people/community.user/blog/2006/09/07/email-reporting
    Regards,
    Phani
    Reward points if Helpful

  • I have an Iphone 3.  How do I..can I..mute the phone's mic when I have a headset plugged in?  The headset worked but I got feedback and echo from the phone's mic.

    Hi

    This article should help you get your photos and videos transferred over   The iPhone should be listed next to the local hard drives in My Computer. Right click on it there and then choose the import option.  The article will also help you if the iPhone isn't recognized by Windows at all.

  • Creating a Pages Newsletter and embedding into the body of an email???

    I have created a newsletter that I want to send to my clients via email, but I do not know if that is possible. I don't want to send it as an attachment, because some people will not even open it. Is there a way I can embed my flyer into the email body so right when people open the message it's there?

    The only way to do what you are asking about is to create an html email. This is possible and assuming you are using Leopard, you can use Mail to do this. Start a new email and select the Stationary button that by default is on the right corner of the new email message window.
    Pages cannot be used to create html code and the only way to use Pages to create your newsletter would be to create a PDF and attach it. The other possible option would be to send your email with a link to a webpage. You could experiment with using the Share to iWeb function and see if this could work for you. (Since I swore off - not to mention at - iWeb some time ago I don't know how well this would work.)

Maybe you are looking for

  • Serialization in pieces

    As part of a distributed database application, I'm often in the situation of having to deal with lots of results from a query. I'd like the server to split those results into "pieces", so that the client can start processing them as they come along.

  • AD attribute names in other languages

    Hi, I'm planning some .NET development into AD and was wondering about the effect of multi-languages. If I write a query to filter on eg. objectClass, in English I would use: ds.Filter = "(objectClass=organizationalUnit)"; Would 'objectClass' & 'orga

  • ChaRM Reporting - Transport Request, Tak and Owner columns not filled

    I am using ChaRM reporting functionalities (/TMWFLOW/REPORTING transaction). When I select "display header, project, task list and transport", transport request, task and owner columns are not filled with values. What is the problem? Thanks Antonello

  • Exporting metadata from folder

    This isn't specifically a Bridge question, but I figure if anybody knows how to do this, it'll be you folks... I'd like to create an export of the files in a folder with some of the metadata.  Specifically, I want the filename, image width, and image

  • Creating New Folders using Windows Explorer is very slow

    Hi, We have a SharePoint 2013 environment upgraded from SharePoint 2010. When working with Windows Explorer, users are able to navigate the folders normally without any issues. However, if a user tries to create a new folder from inside Windows Explo