Jump to content

y

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by y

  1. @Grumpy Old Man

    yes i get the "Thank you for visiting. come back soon!" msg when the page first loads

     

    @Advanced Member

    thanks , finaly i got the idea ..... i didn't know the defference between goodbye; and goodbye();

    but calling the function it self didn't work .... no msg appears when unloading the page at all ...!

     

    any suggitions ?

     

    please help :(

  2. hello :)

     

    i'v got a problem with th onunload event testing script

    it must fires only with the window onunload

    but it fires with load either .... why ?

    there's somthing wrong i don't know what it is ...

    please help

     

    here is th html code

     

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script type="text/javascript">
    function hello(){alert("welcome to my page");}
    </script>
    <script type="application/javascript" src="script.js"></script>
    </head>
    <body onload="hello()" >
    </body>
    </html>
    
    

     

    and here's the script code

     

    
    window.onunload = goodbye();
    function goodbye(){
    alert("Thank you for visiting.come back soon!");
    }
    //window.addEventListener('unload',goodbye(),false);
    
    

    i've tried the inline calling with body tag , the window.onunload calling and the lestiner calling

    nothing works right

     

    please help coz i'm a new :)

    thnx

  3. hi

     

    i made a procedure to add into two tables at once

    but i tried to trace it's errors to rollback and it not working as i supposed

     

    here is the procedure with the error handler

     

    create procedure sp_multi_insert
    (in p_name varchar(50),in p_address varchar(100),in p_telephone varchar(20),in p_notes varchar(100),
    out p_return_code tinyint unsigned)
    begin 
    declare exit handler for sqlexception
    begin 
    set p_return_code=1;
    rollback;
    end;
    declare exit handler for sqlwarning
    begin 
    set p_return_code=2;
    rollback;
    end;
    declare exit handler for not found
    begin
    set p_return_code=3;
    rollback;
    end;
    start transaction;
    insert into emp(name) values(p_name);
    insert into emp_det(id,address,telephone,notes)
    values(last_insert_id(),p_address,p_telephone,p_notes);
    commit;
    set p_return_code=0;
    end

     

    but every time i tried to call the procedure even if i passed wrong params or null

    the return code comes back with 0

     

    call sp_multi_insert('','','','',@x);
    
    select @x;
    

     

    no values returns form sqlwarning handler or sqlexceptions

    why ??? what's wrong with the procedure statment or the calling ???

     

    or who to trace the bug and rollback ????

     

     

     

  4. hello :)

     

    please...

    I'd like to know what's the difference between these two procedure statements :

     

    one with a transaction :

    begin 
    start transaction; 
    insert into emp(name) values(p_name); 
    insert into emp_details(id,address,phone) values(last_insert_id(),p_address,p_phone);
    commit; 
    end

     

    and the other is without the transaction :

    begin 
    insert into emp(name) values(p_name); 
    insert into emp_details(id,address,phone) values(last_insert_id(),p_address,p_phone);
    end

     

    which one is better ???? and why ???

     

    plz explain it simply coz i'm a beginner

     

     

  5. hello falks

     

    please i've done this procedure to insert into two related tables

     

    create procedure sp_new_empdet
        -> (in p_name varchar(50),in p_address varchar(100),in p_phone varchar(20))
        -> begin 
        -> insert into emp(name) values(p_name);
        -> insert into emp_details(id,address,phone) values(last_insert_id(),p_address,p_phone);
        -> end;
        -> $$
    

     

    the procedure created successfuly, but when i call it to add row like this

    call sp_new_emp('y1','y1address','y1123');
        -> $$
    ERROR 1318 (42000): Incorrect number of arguments for PROCEDURE db1.sp_new_emp; expected 1, got 3
    

     

    please help me to correct the error in code

     

    thnx

     

     

  6. hi duds :)

     

    plz i need to know which version of mysql and phpmyadmin supports stored procedures

    and plz i need to know as well from which tab i can make one

     

    sorry but plzkeep it simple coz i'm a biggner

     

    thnx

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