Jump to content

Sudantha

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Posts posted by Sudantha

  1. I want to display pictures in a table using a PHP loop or something, for example 3 pictures in one row, and then when that row has filled, move to the next row, So I can have a grid of pictures, (similar to that on facebook, when your viewing photo albums)... But I've no idea how to do it!

     

     

    just echo the HTML tags inside the loop

     

    
    while($data=mysql_fetecharray($result){
    
    
    echo "<img src=".$data['image_path']."width=xx hight=xx><img>"
    
    }
    
    
    

  2. Guys i need to get the return value from this code how to do it ?  :confused:

     

    
    CREATE PROC getLogin @username varchar(50),@password varchar(50)
    AS
    
    
    
    if exists (SELECT * FROM Operator WHERE Call_ID=@username AND PASSWORD=@password)
    BEGIN
    
    return 1
    END	
    
    else
    
    return 0
    
    
    

     

     

     

    MY php code is following

    
    $stmt=mssql_init('getLogin',$connection);
    mssql_bind($stmt,"@username",&$uid,SQLVARCHAR,false,true,60);    
    mssql_bind($stmt,"@password",&$password,SQLVARCHAR,false,true,60); 
    $result=mssql_execute($stmt);
    
    $arr=mssql_fetch_row($result); 
    
    
    

     

  3. Hi guys i have a problem creating stored procedures in MySQL 5.1.45 through phpMyAdmin 3.2.4 , it ways give a SQL error 

     

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4

     

    Some how i manged to create two stored procedures and they are working properly , thing is even i change the variable names and procedure name and  use the same code and compile it gives the same error  :confused:

     

    DROP PROCEDURE IF EXISTS getacc;.

     

     

    CREATE PROCEDURE getacc( IN uname VARCHAR(50), OUT cbal VARCHAR(50))

     

    SELECT account_balance INTO cbal FROM customers WHERE username=uname;.

     

  4. Nope, webhost. But other php files work, so it can't be the PHP on the webhost?

     

    yes !  it cant be ,, btw to u get any data from a database in this page ?  does that  db contain any encrypted stuff ? [some times encrypted stuff  may be showed in stupid characters ]

     

    some times it may be ur browser rendering prob .. change that and see !

  5. Guys i need to run a Trigger in MySQL

     

    My code :

     

     

    $sql="INSERT into transactions values (NULL,'DIRECT DEBIT','".$acc."','2010/5/1','1.20PM',".$updated_res_acc_balance.",'0')";

     

     

    DROP TRIGGER IF EXSITS

     

    CREATE TRIGGER updatesender AFTER INSERT

    ON transactions FOR EACH ROW

    UPDATE customers SET account_balance=".$updated_sender_acc_balance." WHERE username ='admin'

     

    ";

     

     

    this gives a error  :confused:

     

  6. are u getting the error or a warning like this ?  “Cannot send headers; headers already sent ….” , i faced thing problem a lot but by reading and experience i overcome this by several ways

     

     

     

    1. Dont not print or echo before this line

    2. HTML tags before header() will make problems

    3. finally the blank spaces

    don’t keep any blank spaces before or after the <?php ?> tags ,

     

    I think in huge web projects its better use only a one header in a function and re use it bu passing the $url to the function this will minimize the code debugging time  . :D

  7. Just pass your sting to sha1($string); or md5($string);  8)

     

    Then how will the user read it later?

     

    sorry actually i forgot that md5 and sha1 are one way encryption !  :-[ . anyways  is there any way in php with two way encryption except for ur own algorithm  ;D

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