Jump to content

landavia

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

Posts posted by landavia

  1. ???

    mysql_connect ( [string server [, string username [, string password [, bool new_link [, int client_flags]]]]] )

     

    theres no db in it!!

     

    <?php
    $db_dbase="nwmarria_customers";
      $db_host="localhost";
      $db_pass="password";
      $db_user="nwmarria_dbuser";
    
    if (isset($_POST['submit'])) {
        $first_name = $_POST['firstname'];
        $last_name = $_POST['lastname'];
        $email = $_POST['email'];
        $output_form = 'no';
    
        if (empty($first_name) || empty($last_name) || empty($email)) {
          // We know at least one of the input fields is blank 
          echo 'Please fill out all of the email information.<br />';
          $output_form = 'yes';
        }
      }
      else {
        $output_form = 'yes';
      }
    
      if (!empty($first_name) && !empty($last_name) && !empty($email)) {
        $dbc = mysql_connect($db_host,$db_user,$db_pass)
           or die('Error connecting to MySQL server.');
    
    
        $db_selected = mysql_select_db($db_dbase,  $dbc );
    if (!$db_selected) {
       die ('Can\'t use foo : ' . mysql_error());
    }
    
    
    ?>
    

    4 u concern try type  $dbname.. is better than $db_dbase

  2. How can I catch the name field of table1 and make it correspond with table2 name? ???

    u need a script to build a same table.. sry.. late respond

    hmm.. u should try it out..

     

    after build table2.. then copy to table 2

    plzz.. remind to backup DB

    *is happen 2 me AGAIN

  3. using if will be better

     

    hmm.. i take from

    while ($row = mysql_fetch_array($result)) {
       print "<tr>
        <td width=\"30\" valign=\"middle\"><img src=\"images/notepad.png\" width=\"23\" height=\"18\" /></td>
        <td valign=\"bottom\"><li class=\"category\"><strong><a href=\"sub.php?category_id=$row[id]&cat_name=$row[category]\">$row[category]</a></strong><br><span class=\"sub\">$row[sub]</span></li></td>
      </tr>";
    }

     

    <?php
    $i=0;
    print "<tr>";
    while ($row = mysql_fetch_array($result)) {
    print "\n<td width=\"30\" valign=\"middle\"><img src=\"images/notepad.png\" width=\"23\" height=\"18\" /></td>
        <td valign=\"bottom\"><li class=\"category\"><strong><a href=\"sub.php?category_id=$row[id]&cat_name=$row[category]\">$row[category]</a></strong><br><span class=\"sub\">$row[sub]</span></li></td>";
    $i++;
    if($i%2==0)   print "</tr><tr>";
    }
    print '</tr>';
    ?>

  4. >>$sql = "SELECT * FROM `comments` WHERE comto = '$username'";

    i believe the main problem in here

     

    try

    <?php
    echo "view comment from $username<hr/>";
    $sql = "SELECT * FROM `comments` WHERE comto = '$username'";
    $query = mysql_query($sql);
    while ($row = mysql_fetch_assoc($query)) {
    $from = $row['comfrom'];
    $message = $row['commen'];
    print_r($row);echo "<br/>\n";
    print("$message");
    }
    ?>

    if this goes well.. perhaps..

     

    >><? $_SERVER['PHP_SELF']; ?>

    i think something missing here?

     

    >>id="$comfrom"

    about this id.. better give name that's not use $ in the front

     

    >>mysql_query($sql) or die(mysql_error());

    change this into

    <?php $con=mysql_query($sql) or die(mysql_error()); ?>

    i think the problem (query) not show.

     

    suggestion:

    if you want advance php. try remember this. to test script.. u must give FALSE input.. and then have error message in it. well.. you done a pretty damn good script but nobody perfect

  5. this script aren't should use AJAX.. well..

    to be honest

    if (mail($to, $subject, $body)) {
      echo("Message successfully sent!");
    } else {
      echo("Message delivery failed...");
    }

    in my own script.. this are failed ???

     

    but when i type this

     

    $stat=mail($mailto,$mailsbj,$mailmsg, $headers);

     

    it work?

  6. forumnz did you ever get this to work for you. I have the same script and am having problems with the second list.

    interesting.. but the result for TS are confuse us

     

    i think the problem are the place you put your script

    in my ajax (same problem).. I put 3 div (this div was the place where list will be).. hmm.. it's kinda hard to explain

    <div name=text1>/*my 1st list goes here */<div>
    <div name=text2>/*my 2st list goes here, the 1st list are selecter */<div>
    <div name=text3>/*my 3rd list goes here, where 2nd list already selected */<div>
    

    sry.. not much to help

    you should try this example

     

     

    there 3 list = A, B, C

     

    A is Nation like Washington DC, California etc

    B is name of City

    C is name of street

     

     

  7. theres no query that able to move table

    CREATE TABLE `bintaro_medrec`.`terkini` (
    `ID` int( 5 ) NOT NULL AUTO_INCREMENT ,
    `KATEGORI` int( 1 ) default NULL ,
    `HARI` varchar( 6 ) default NULL ,
    `TANGGAL` varchar( 20 ) default NULL ,
    `KOTA` varchar( 30 ) default NULL ,
    `JUDUL` varchar( 200 ) default NULL ,
    `ABSTRAK` varchar( 250 ) default NULL ,
    `IMAGE1` varchar( 50 ) default NULL ,
    `IMAGE2` varchar( 50 ) default NULL ,
    `EXPIRE` int( 1 ) NOT NULL default '0',
    `CONTENT` text,
    PRIMARY KEY ( `ID` ) ,
    UNIQUE KEY `id` ( `ID` ) ,
    KEY `id_2` ( `ID` ) ,
    KEY `expire` ( `EXPIRE` ) ,
    KEY `EXPIRE_2` ( `EXPIRE` )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =99;
    
    INSERT INTO `bintaro_medrec`.`terkini`
    SELECT *
    FROM `bintaro_backup`.`terkini` ;
    
    DROP TABLE `bintaro_backup`.`terkini` ;

    try copy this script

    1. copy all data from table1 to table2

    2. drop table 1.

    3. check.. if any of the process error

  8. imho phpsensei and lostprophetpunk answer same like i want to say

    but plz.. we don't understand what do you want!? please describe

     

    1. what table do you want to search?

     

    2. is this ALL table on 1 database or just 1 table?

     

    3. in 1st u said Data exist (mean data inside table) but next you said rows (rows name maybe?).. where the correct?

  9. Are you getting an error message?

     

    nope it does the echo and there is no data in the actuall DB i think it could be because i took out the WHERE section out of the query ?

    yap but no

    reading for your sql query.. imho... that query will change EVERYTHING in your table settings into what u update

     

    forexample.. it there 4 rows.. ALL 4 rows will change all

     

    i kinda curios about this

    <?php
    if(isset($_POST['submit'])) {
      $footer = strip_tags(mysql_real_escape_string($_POST['footer']));
      $header = strip_tags(mysql_real_escape_string($_POST['header']));
      $title = strip_tags(mysql_real_escape_string($_POST['title']));
      $sql = "UPDATE settings SET footer = '$footer', header = '$header', title = '$title'";
      mysql_query($sql) or die(mysql_error());
      echo ("Update Complete");
      exit;
    }
    ?>

    can you change

    like this

    <?php
    print_r($_POST); //hmm i wan't to know what in this?
    if(isset($_POST)) {
      $footer = strip_tags(mysql_real_escape_string($_POST['footer']));
      $header = strip_tags(mysql_real_escape_string($_POST['header']));
      $title = strip_tags(mysql_real_escape_string($_POST['title']));
      $sql = "UPDATE settings SET footer = '$footer', header = '$header', title = '$title'";
      mysql_query($sql) or die(mysql_error());
      echo ("Update Complete");
      exit;
    }
    ?>

    >>If there is no data in the table, what exactly is it supposed to be updating?

    i assume there a data inside ^^

    your answer are correct too ^^

×
×
  • 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.