Jump to content

Nandini

Members
  • Posts

    160
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Female

Nandini's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi Everybody I am doing online education portal. Teachers and students will be registered on this site. Student will search teachers and create schedule to learn subjects. For that student can pay to the teacher some amount. So that student can increase his/her balance. That means he can transfer some money to website company account through credit card or paypal or google checkout. I did credit card part. But i am not getting any idea to do in paypal. That means student can enter amount and click paypal button, it should show paypal page. So that he can login into his paypal account and pay that amount. After pay that amount we can get IPN (Instant Payment Notification). So that we can store that amount into my database under that student ID. Please tell me how can i do this?
  2. Thanq Robert. If we should not loop more than once, how can i solve this issue. Please let me know.
  3. Hi I am using php5 and Mysql I want to generate user id like phone format (Ex: xxx-xxx-xxxx). and check that user id exists in database or not. if yes, i have to generate new user id etc. If that user id not in database, i have to insert user id for new user. Means i have generate unique user id for login purpose. Generating user id is working fine. availability of user id also ok for me by using mysql_num_rows() function. But if user id i exists in database, how can i generate new user id. All this will be done in single instance (When user click on submit button from registration form). Here is my script. <?php function UserID() { $starting_digit=5; $first_part1=rand(0,99); if(strlen($first_part1)==1) { $first_part="0".$first_part1; } else { $first_part=$first_part1; } $second_part1=rand(1,999); if(strlen($second_part1)==1) { $second_part="00".$second_part1; } elseif(strlen($second_part1)==2) { $second_part="0".$second_part1; } else { $second_part=$second_part1; } $third_part1=rand(1,9999); if(strlen($third_part1)==1) { $third_part="000".$third_part1; } elseif(strlen($third_part1)==2) { $third_part="00".$third_part1; } elseif(strlen($third_part1)==3) { $third_part="0".$third_part1; } else { $third_part=$third_part1; } $userid=$starting_digit.$first_part."-".$second_part."-".$third_part; return $userid; } $random_userid=UserID(); $sql=mysql_query("select * from users where user_id='".$random_userid."'"); if(mysql_num_rows($sql)==0) { $insert=mysql_query("insert into users (user_id) values ('".$random_userid."')"); } ?> If user id not exists in database, that user id inserting in database successfully. If not, empty value is inserting, not generating new user id. Can any one help me out please.
  4. I am not trimming any value. Ho can i do this. I am not well in php. Please
  5. Hi all I have one database filed like price with DECIMAL(30,2). While inserting values, those values are rounding. I am inserting values through PHP Coding. For example, I am inserting 5.625 but it is inserting as 5.63 I want to insert value 5.625 as 5.62. I have taken datatype as DECIMAL(30,3) but no use. Here is my code <?php mysql_connect("localhost","root",""); mysql_select_db("sample"); echo "Product Volume: 3.75<br>"; echo "Amount: 1.5<br>"; $total=3.75*1.5; echo "Total: ".$total; $total_insert=mysql_query("insert into test (price) values ('".$total."')"); ?>
  6. I got a final array like this Array ( [0] => id: 28 [1] => property_id: 691 [2] => report_id: 28 [3] => no_records: 0 [4] => bankruptcy: 0 [5] => foreclosure: 0 [6] => accounts: 45 [7] => publicrecords: 34 [8] => summary: 1 [9] => id_date: 06/24/2011 15:47:46 ) I want to display 3 values per row. But same values coming for every row. Here is my code. <?php echo "<table border='1' width='400'>"; $thumbrows=count($credit_array)/3; for($r=0;$r<$thumbrows;$r++) { echo '<tr>'; for($c=0;$c<3;$c++) { echo '<td>'.$credit_array[$c].'</td>'; } echo '</tr>'; } echo "</table>"; ?> Can any one tell me what is the problem.
  7. ya its working fine. But how can i set 3 values per row in table. please
  8. output for $row1 is: Array ( [id] => 28 [property_id] => 691 [report_id] => 28 [no_records] => 0 [bankruptcy] => 0 [foreclosure] => 0 [accounts] => 45 [collection] => [title] => [mortgagerepo] => [mortgagechargeoff] => [paid_off] => [charge_off] => [past_due] => [current] => [unknow] => [publicrecords] => 34 [judge] => [repos] => [summary] => 1 [comments] => [comments1] => [id_date] => 06/24/2011 15:47:46 )
  9. Otherwise Tell me how can i run query to get all the filled MySQL fields. I don't want to get empty fields. I don't know which field is empty and which field is not empty.
  10. I am getting errors by using this code. Warning: Invalid argument supplied for foreach() in here is my code <?php $sql=mysql_query("select * from report where report_id='28'"); $row1=mysql_fetch_assoc($sql); echo '<table>'; foreach($row1 as $k=>$v) { echo '<tr>'; foreach($v as $field) { if(trim($field['accounts']) != '') echo '<td>'.$field['accounts'].'</td>'; } echo '</tr>'; } echo '</table>'; ?>
  11. hi we don't want empty cells. Check my example in our question.
  12. This is fine. But i have to fit 3 fields into one <tr>. How can i got to next <tr>. Why because we don't know how many fields are filled.
  13. I mean i want to display only non empty fields.
×
×
  • 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.