User Profile

Collapse

Profile Sidebar

Collapse
chathura86
chathura86
Last Activity: Nov 19 '10, 12:59 AM
Joined: May 11 '07
Location: Homagama, Sri Lanka
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • yes you can execute those actions and let the php script to upload the file (not by using a form in the php site which submit to the .net site)
    any way you cannot do anything without visibility to each other. you need to have a way to pass a message from one server to another. a ip, domain or any other

    Regards...
    See more | Go to post

    Leave a comment:


  • yes a web service can be used to transfer the file, encode the file as base64 or similar and decode it in the C# and save it

    or if you can create a file upload form in C# and submit that form from PHP (Snoopy will help you)

    as the third you can also use FTP (FTP server in windows and client in php server)

    Regards
    See more | Go to post

    Leave a comment:


  • chathura86
    started a topic MySQL secure root account

    MySQL secure root account

    hi,

    is there a way to install mysql in such a way that even
    the os administrator cannot change or reset the mysql root password.

    the requirement is that i have an application which use mysql as the database. that application will be installed in clients machine. i want to make that database secure that users will not be allowed to directly log in to the database and view/change data. application install does the...
    See more | Go to post

  • chathura86
    replied to problem in fetching date from database
    What was the output you got? Are you sure that you have records for the query? Try the below and post the result:
    Code:
     while($res =  mysql_fetch_array($sql))
      {
       var_dump($res); 
      }
    See more | Go to post
    Last edited by Niheel; May 21 '10, 12:58 AM. Reason: Punctuation and readability

    Leave a comment:


  • chathura86
    replied to Not unique table/alias
    You are joining the table VARA two times so you need to use an alias for the tables.

    eg.
    Code:
    SELECT V1.VID, V1.ANTAL, V1.PRIS, LEVERANTOR.LEVID, LEVERANTOR.TELEFONNUMMER FROM (VARA V1 INNER JOIN LEVERANTOR ON V1.VID=LEVERANTOR.LEVID) INNER JOIN VARA  V2 ON V2.VID=LEVERANTOR.LEVID);
    See more | Go to post
    Last edited by Niheel; May 21 '10, 01:02 AM. Reason: Punctuation. "you" --> "You" and added a "." at the end of the sentence.

    Leave a comment:


  • chathura86
    started a topic stored procedure join multiple result sets

    stored procedure join multiple result sets

    Is there a way to join few results sets in to a one result set? I have a table with recursive relation.

    eg. User table has a column with boss with the relation to the same
    User table

    Code:
    +-------+---------------+-------+
    | id	| name		| boss	|
    +-------+---------------+-------+
    | 1	| User 1	| NULL	|
    | 2	| User 2	| 1	|
    | 3	| User 3	| 2	|
    | 4	| User 4	| 3	|
    | 5	| User 5	| 4	|
    ...
    See more | Go to post
    Last edited by Niheel; May 21 '10, 01:00 AM. Reason: punctuation and grammar

  • i dont think so, cuz as far as i know js cannot connect to a database
    on the other hand even if you can since you have the connection string on the
    js, anyone can see your usernames and passwords so i guess you should use
    asp to do that stuff

    Regards
    See more | Go to post

    Leave a comment:


  • you can build a sql query to create the table and execute it using mysql_query()

    http://sql-info.de/mysql/examples/CR...-examples.html
    check the link for instruction of creating tales in mysql

    can you post your code (what you have done so far) here so i can see and help you further.

    keep i mind that creating tables dynamically is not a good practice
    unless you are using it for a installer...
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to Best Database Class
    in PHP
    well im using PDO and still seems ok (both portability and performance)

    now im using Doctrine ORM which is very cool
    (Doctrine also uses PDO)

    Regards
    Chathura Bamunusinghe
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to find a specific row in a set of rows
    Code:
    (SELECT @rownum:=0) r
    initialize the @rownum (mysql variable) to 0

    Code:
    (X) tb1
    create a temporary table from your sql and name it as tb1


    Code:
     SELECT @rownum:=@rownum+1 rownum, tb1.*
         FROM 
             (SELECT @rownum:=0) r, 
             (X) tb1
    this will select all from tb1 and for each row you will have the row number
    because oyu are increasing the @rownum by 1

    ...
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to find a specific row in a set of rows
    you can use a sequence row to number the record set and get it

    eg

    let say you got the above result set from query X

    Code:
    select rownum from
    	(SELECT @rownum:=@rownum+1 rownum, tb1.*
    	FROM 
    		(SELECT @rownum:=0) r, 
    		(X) tb1 ) T
    where (T.valid > 1)
    Regards
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to PHP progress bar?
    in PHP
    All the details you need can be found in your tutorial

    http://www.johnboy.com/php-upload-progress-bar/

    for more info read the php manual

    http://php.net/manual/en/book.apc.php

    Regards...
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to mysql_connect cannot connect localhost
    in PHP
    i got the same kind of problem once (when i got a pc with fresh vista installation), the problem was vista did not properly resolve the host file. i did not found any proper solution either, anyway check about this issue also if you did not find any good solution. (could be ipv6 not sure)

    Regards
    See more | Go to post

    Leave a comment:


  • it could be a instance of a form object, some (including me) creates form objects
    from a class (custom made), especially when dealing with ajax so we can send the form values as a json object and map with the form object, im not sure may be some frameworks also support this facility.

    Regards...
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to PHP progress bar?
    in PHP
    please review that code properly

    specially the APC part, which does the magic of sending the upload progress


    Regards
    See more | Go to post

    Leave a comment:


  • check your html source if the select box is populated properly

    Regards
    See more | Go to post

    Leave a comment:


  • i dont know much about rhis virus, if you have any file upload forms in the site make sure to validate uploaded files and also escape any especial characters from form submissions

    Regards
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to Distribute array to other array
    in PHP
    Code:
    $stdCount = count($students);//will give 5
    $lecCount = count($graders);//will give 3
    $grader = explode(',', $grader);
    u are assigning the count before exploding the string

    explode both of them before getting the count

    Regards
    See more | Go to post

    Leave a comment:


  • go through this manual, i managed to create a real time upload progress bar with this module (with the help of ajax).

    http://php.net/manual/en/book.apc.php

    but the downside is most hosting servers does not support this extension yet
    and i did not found a windows version of the module.
    so make sure of that. other than that it works perfectly

    Regards...
    See more | Go to post

    Leave a comment:


  • chathura86
    replied to Distribute array to other array
    in PHP
    try this one

    Code:
    <?php
    	$students = array('u1', 'u2', 'u3', 'u4', 'u5', 'u6', 'u7', 'u8', 'u9', 'u10');
    	$lecturers = array('l1', 'l2', 'l3');
    
    	$class = array();
    
    	$stdCount = count($students);
    	$lecCount = count($lecturers);
    
    	for($i=0; $i < $stdCount; $i++)
    	{
    		$class[$lecturers[$i%$lecCount]][] = $students[$i];
    	}
    
    	echo "<pre>";
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...