Results 1 to 10 of 10
  1. #1

    Default Error in PHP! Help..


    Gud day! ga self study ra ko ani.. patabang tana ko dili ko kabalo magtan.aw ug error sa php beginner pa. unsa pasabot ani na error?

    "<br /><b>Notice</b>: Undefined index: fname in <b>C:\xampp\htdocs\Tutorial\learning_php\learning_ php\web_forms\web_forms.php</b> on line <b>199</b><br /> " ug kani pud


    "
    /Tutorial/learning_php/learning_php/working_with_databases/connecting_to_data.php
    Intro: Let's do a little generic database work!


    Warning: mysql_connect(): Access denied for user 'user1'@'localhost' (using password: YES) in C:\xampp\htdocs\Tutorial\learning_php\learning_php \working_with_databases\connecting_to_data.php on line 8
    Could not connect: Access denied for user 'user1'@'localhost' (using password: YES)"

    Salamat daan!
    Godbless!

  2. #2

    Default Re: Error in PHP! Help..

    Your will need to define the fname,

    Code:
    sample.html
    <form method="POST" action="sample.php">
         <label>Firstname</label>
         <input type="text" name="fname">
         <input type="submit" value="Submit">
    </form>
    
    
    
    sample.php
    
    <?php
    
    $fname = $_POST['fname'];
    
    if (isset($fname))
       echo 'Firstname :' . ' ' . $fname;
    
    ?>
    Kanang ikaduha nimo problema need na nimo i grant privileges ang user sa MySQL, in case you are using MyQSL,

    Code:
    GRANT SELECT, INSERT, DELETE ON db_name.* TO db_user@'localhost' IDENTIFIED BY 'db_passwd';
    
    FLUSH PRIVILEGES;
    
    or 
    
    GRANT ALL ON *.* TO root@'localhost' IDENTIFIED BY 'db_passwd';
    
    FLUSH PRIVILEGES;
    WHERE: *.* is equal to db_name.db_table.

  3. #3

    Default Re: Error in PHP! Help..

    Salamat kaau boss. ugma na naku ni buhaton ka tulogon nku. ehehehe

  4. #4

    Default Re: Error in PHP! Help..

    Warning: mysql_connect(): Access denied for user 'user1'@'localhost' (using password: YES) in C:\xampp\htdocs\Tutorial\learning_php\learning_php \working_with_databases\connecting_to_data.php on line 8
    Could not connect: Access denied for user 'user1'@'localhost' (using password: YES)"
    setup a database connection boss:
    sample code ni xa sa pagconnect.

    Code:
    $local = "localhost";
    $user = "root";
    $pass = "";
    $db = "your_db_name";
    
    $link = mysql_connect('$local', '$user', '$pass'); // connect to localhost
    if(!$link){
        die('CANT CONNECT TO DATABASE: '.mysql_error());
    }
    mysql_select_db('$db', $link); // connect to database

  5. #5

    Default Re: Error in PHP! Help..

    try to check if 'user1' has access to your database ug naa cyay access rights sa schema

  6. #6
    Senior Member thuzhar's Avatar
    Join Date
    Nov 2010
    Gender
    Male
    Posts
    561
    Blog Entries
    1

    Default Re: Error in PHP! Help..

    Quote Originally Posted by ondoy View Post
    try to check if 'user1' has access to your database ug naa cyay access rights sa schema
    yep. sakto si boss ondoy. hehe. basin wae rights si user1 sa db.

  7. #7

    Default Re: Error in PHP! Help..

    be sure nga ang imu ge post kay any other field at least nag describe cya nga ni exist ang name sa imu input ang $_POST['fname'] or $_GET['fname'] or any request...mysql_connect() error? check you mysql connection settings or create another account...simple..

  8. #8

    Default Re: Error in PHP! Help..

    masabot raman ang error boss. basaha lng og tarong. or copy paste then google imo error. para makat.on ka og error tracking. kaya rana nimo boss.

  9. #9

    Default Re: Error in PHP! Help..

    boss murag wala pa ka nakabalo sa basics in connecting to db to accessing data from database etc etc.
    i suggest watch tutorial sa youtube naay nindot didto kadtong newboston php tutorial. mao to akong ga cge og tan.aw og nakat.on pd ko didto before i shift to asp.net c#

    good luck.

  10. #10

    Default Re: Error in PHP! Help..

    Salamat sainu mga reply... wala pa jud nku na buhat na kay naguba ako PC palpak kaau.. karon pa nku na auson.. ehehe


    Godbless!

  11.    Advertisement

Similar Threads

 
  1. help, im stuck! in PHP programming.
    By emailroy2002 in forum Programming
    Replies: 16
    Last Post: 07-08-2010, 11:43 PM
  2. Replies: 12
    Last Post: 10-30-2008, 01:24 PM
  3. Replies: 33
    Last Post: 10-17-2008, 04:09 PM
  4. Streaming/Playing videos in PHP..help.
    By ichiriki in forum Programming
    Replies: 3
    Last Post: 10-08-2008, 05:15 PM
  5. Replies: 2
    Last Post: 09-11-2008, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top