This topic is locked

2 questions

6/10/2008 10:39:12 PM
PHPRunner General questions
E
everyday_ author
  1. how to do auto number like below?
  2. name | address | phone | email
  3. name | address | phone | email
  4. name | address | phone | email
  5. name | address | phone | email
  6. how to include string that were search in *_list.php?
    example: if user search Jack Nicholson, I want to add "Your Search Jack Nicolson = 4 results"

J
Jane 6/11/2008

Hi,
please see my answers below:

  1. create another column for auto number value, then turn on HTML mode and add following code to this column:
    {$row.1recno}


2. use custom event (Insert PHP code snippet option on the Visual Editor tab) for this purpose.

Here is a sample:

global $conn;

$str = "";

if (@$_REQUEST["a"]=="search" && @$_REQUEST["SearchFor"] && @$_REQUEST["SearchField"])

{

$rs = db_query("select count(*) from TableName where ".$_REQUEST["SearchField"]."='".$_REQUEST["SearchFor"]."'",$conn);

$data = db_fetch_numarray($rs);

$str = "Your Search ".$_REQUEST["SearchFor"]." = ".$data[0]." results";

}

echo $str;