Jump to content

numan82

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by numan82

  1. why you dont use smarty a very good templating engine for PHP
  2. I did solve my problem any body need help regarding this can contact me. cheers
  3. study the GD Library for PHP it comes with PHP and is very powerful tool to create the gantt charts in php thanks
  4. hi I am using nuSoap (php based) for connecting to one of the web service which is implemented in .net the problem that I am having is the use of digital certificate, I dont have any clear idea where I need to attach the certificate to my soap request message, any one having solution please help me out. thanks! looking forward. numan
  5. well to be more accurate it is exception handling in PHP, that can show friend messages in case of exceptional errors /fatal errors. thanks
  6. well you can get the form array values (That you want to store in DB) through $_REQUEST. make a new array $MyArray = array(); $MyArray =$_REQUEST; now $MyArray contains the submitted data, it is easy to store in to the DB.
  7. hi, the simple solution is using for each loop on $_Request(it is a request array that contains the form data being to be submitted) for example foreach($_Request as $key=>$value) { $InsertArray = $Value; } and than using this $InsertArray, you can insert a records into the specifice table of your DB. Hope it it will give you some idea. Thanks!
  8. Hi Thanks for the detail comments! But I've different situation and the situation is, I am using socket programming in PHP and sending data from client script to server Database and Server Database is storing it. so in this case, in the begining I am sent all the data and now in client if there are some updates I want to get that updates and want to send it to server. This is not website, but infact client/server application that sends data from client to server.
  9. hi, but the most important thing you are missing here is, Which I got at glance is whenever you declear the object of any class it should be like this $obj= new ClassName();//Class Name if you notice your code carefully you are not using parenthesis with your class name when creating object so private $database = new database;//wrong approach try this private $database = new database();//correct one. try out this! I am sure the parse error for new line will be eliminated. Thanks! Keep Smile Numan Khan
  10. yeah ofcourse. there are various tutorials available for OOP PHP, if you try out it in Google, anyhow it is also a great fun to program OOP. The one with video is http://www.killerphp.com
  11. I’ve created the script for sending some data, I am using query on my tables to get the values and than send it via socket_write and the data is being saved in server database The only thing that confusing me more, is that if in my client database, there are some changes like updates and I want to send only the updated record what should I do? Any Idea….? Thanks in Advance
  12. hi scott, yeah the function can be called from the class being created. and it can done like this class MyClass{ function DoSomeThing($host,$username,$pass){ //your code for mysql connections come here like mysql_connect etc... }//function ends here }//class ends here Now you can create the object of this class and can pass the host,username and password to connect to mysql For example $ConnectorObj=new MyClass(); $ConnectorObj->DoSomeThing($host,$username,$pass); Note: Don't forget to include the class php where you are using the class like include('MyClass.php'); Thanks! }
  13. hi friends, I am trying to clarify the logic to find the updates in various tables, let me explain it through code Query = SELECT Std_Name,Std_Grade,Courses From [table][tr][td] Student A INNER JOIN [table][tr][td] Courses B on A.Std_Id=B.Std_Id Note: Std_Id is Primary key of [table][tr][td] Student and B.Std_Id as Foreign Key in [table][tr][td] Courses after all I get this result. if there is some modification in these two tables, like student name changes or coures changes, than How Would I know the changes.... is it bit confusing? the one Idea, I've is to make new table and insert this generated query into that, and every time I run this new query I need to compare this new query with the old values saved in the tables
  14. Hi I am having array which stores the Date Format as DD-MM-YYYY now I want to convert this format and store into the DB field but the DB field accept the format YYYY-MM-DD. so what should I do? Thanks! for example 01/03/2008 which need to convert first YYYY-MM-DD Thanks in Advance.
  15. hi If you can write the code than it is much better to respond on that instead of confusing statements. Thanks Numan
  16. hi to all, I am having little problem with Date Format, actully I am reading data from MS SQL Server 2000 and inserting into the MySQL. The Date format of SQL Server 2000 is like 19990120 and MySQL accept the date in the format of YY-MM-DD, I tried several function but could not get the solution, I also tried the implode function but it is not working. any help thanks in Advance... Numan
  17. Hi There, I've a little problem, I am converting the mulitdiementional array into string but facing problem code as follow ----- function GettingValue(){ while($row=mysql_fetch_array(result,MYSQL_BOTH)) { $Data[$i]['UserID']=$row['UserID']; $Data[$i]['UserName']=$row['UserName']; $i++ } return $Data; } Now Want to convert this multidiemsional array into the string, I know the implode function but it is not working in my case for example $result=implode("@",$Data); echo $result; it shows only Array@Array@Array.....etc it is clear that it is nested array but I don't know the way to come out of this little confusion any help in this regard is highly appreciated. Thanks! Numan
  18. hi I am using socket_bind() for binding the address returns from socket_create() function, doing error checking with socket_strerror(), and it gives out the exact error, and now I want to release the port as soon as it gives out the error, how to do that? below is the code: $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket\n"); $result = @socket_bind($socket,gethostbyname($_SERVER['HOSTNAME']),12362) or die("Could not bind to socket, Please restart the computer-- ". @socket_strerror(socket_last_error($socket)) ); Thanks!
  19. Here is complete form! cheers too! <td valign="top"><form id="form1" name="form1" method="post" action="expenses.php"> <table border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <th valign="top" scope="row"><div align="left">Expense Description:</div></th> <td valign="top"><label> <textarea name="desc"></textarea> </label></td> </tr> <tr> <th valign="top" scope="row"><div align="right">Date:</div></th> <td valign="top"><label> <input type="text" name="date" size=20><td><a href="javascript:showCal('Calendar1')"><img src="images/calbtn.gif" border="0"/></a> </td> </tr> <tr> <th valign="top" scope="row"><div align="right">Amount:</div></th> <td valign="top"><label> <input name="amount" type="text"/> </label></td> </tr> <tr> <th scope="row"> </th> <td> </td> </tr> <tr> <th scope="row"> </th> <td><label> <input type="submit" name="Submit" value="Add" onclick="return checkForm();"/> </label></td> </tr> </table> </form> </td> </tr> <tr> <td> </td> </tr> </table><? if(isset($_REQUEST['submit'])) { $desc = $_REQUEST['desc']; $date = $_REQUEST['date']; $amount = $_REQUEST['amount']; $query ="INSERT INTO expenses_daily(exp_desc,exp_date,exp_amount) VALUES('$desc','$date','$amount')"; $result = mysql_query($query); if(!$result) { echo "Unable to insert record"; exit(); } else{ echo "record Added"; } } ?>
  20. hi to all, I am using isset() function to set the form variables, but it isn't working. here is the piece of code if(isset($_REQUEST['submit'])) { $desc = $_REQUEST['desc']; $date = $_REQUEST['date']; $amount = $_REQUEST['amount']; $query ="INSERT INTO expenses_daily(exp_desc,exp_date,exp_amount) VALUES('$desc','$date','$amount')"; $result = mysql_query($query); if(!$result) { echo "Unable to insert record"; exit(); } else{ echo "record Added"; } } in the form action I am using <form id="form1" name="form1" method="post" action="<? $_SERVER['PHP_SELF'];?>">
  21. Hi to all, I am having a small piece of code, but that causes a big problem I am using query string to get the values from DB and based on that build a page like <a href='?parent={$parentParent}' //{} indicate that I am also using smarty and now when a click on link it get values but my whole page is refresh and I don't want that because I am having other pages which are included in a single page and they are access using tabs and what should I do? to avoid this , Ajax can be the solutions for not refreshing the page! but I am not clear about that. Thanks! Numan Khan
  22. hi, thanks for all responses and replies I solved the problem and the only mistake that I was not passing the return type to mysql_fetch_array($result,MYSQL_BOTH)// MYSQL_BOTH is is the return type for both numric and associative array. it is solved now. Thanks for your hard work and co-operation class Tree{ function buildTree_parent($treeBranch) { $query = "SELECT * FROM links WHERE address = '$treeBranch'"; if ($result = mysql_query($query)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($result,MYSQL_BOTH)) { $branches[] = $row; } } } return $branches; } }// end class definition $mytreeObj = new Tree; $test = $mytreeObj->buildTree_parent($parent); print_r($test); // now it will show all the records }
  23. class Tree{ function buildTree_parent($treeBranch) { $query = "SELECT * FROM links WHERE address = '$treeBranch'"; if ($result = mysql_query($query)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc) { $branches[] = $row; } } } return $branches; } }// end class definition $mytreeObj = new Tree; $test = $mytreeObj->buildTree_parent($parent); echo $test; // now it should show all the records }
  24. Thanks for the response! I'm surprised why I'm unable to get the all records with this code $query = "SELECT * from links"; $result = mysql_query($query) while($row=mysql_fetch_assoc($result)) { $branches =$row; } return $branches; The $branches don't have any record in it, I invoked it by calling this parameter but I'm unable to see any record if do like this $branches[] = $row["Column Name"]; than it shows the value of this column. but I want to have all the records of this table in my $branches array. Thanks! keep smile
  25. that great! let me clarify one more thing about it for the adodb function MoveNext(); we should have $row++. Right or wrong? function buildTree_parent($treeBranch) { $query = "SELECT * FROM links WHERE address = '$treeBranch'"; if ($result = mysql_query($query)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc) { $branches[ ] = $row; $row++; } } } Thanks once again for the response! return $branches; }
×
×
  • 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.