hi linuxer,

buat teman2 yang mungkin membutuhkan,
ini contoh script sederhana (banget) php untuk mengakses mysql,
lebih enak sih dimasukin ke function, jadi bisa dipanggil kapan aja
ada koreksi/tambahan ?


viva linux
  -indra-


--------------------------------------------------
  /* Connect to Database */
  mysql_connect($hostname,$user,$password);

  /* Find The Entry $inputan in Database */
  $result = mysql(database, "SELECT fields FROM table WHERE field
='$inputan'");
  $total_rows = mysql_numrows($result);
  $counter = 0;

  /* Sorry, We cannot find any result */
  if($total_rows <= 0) {
    echo "no record found";
    exit();
  };

  while($counter < $total_rows):

    /* Put data into variable */
    $var1 = mysql_result($result,$counter,"field1");
    $var2 = mysql_result($result,$counter,"field2");

    /* User Defined Function to display the data */
    DisplayIt($var1,$var2);

    /* Loop until the end of the record found */
    $counter = $counter+1;
    endwhile;
--------------------------------------------------


----------------------------------------------------------------------
Unsubscribe: [EMAIL PROTECTED] 
Archive: http://www.vlsm.org/linux-archive/
Linux CD: [EMAIL PROTECTED]



Kirim email ke