Jump to content

satheeshpr

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by satheeshpr

  1. Hi All, I am trying to generate a PDF report using the below code. the report is being generated perfectly. The problem that I face is that, while printing the report the browser disregards the "IF" condition that I have given in the code. Explanation : ----------------- It prints all the data in the MySQL database wherein I wanted the data to be printed only on a certain condition. How do I achieve this?
  2. <!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> <title>Dairy Farm Record Management</title> <link rel="stylesheet" type="text/css" href="C:\Documents and Settings\satheesh\Desktop\dairy_records\styles\styles.css" /> </head> <body bgcolor="#FFEBCC"> <?php if ( isset($_POST["submit"])) { // process form //$db = mysql_connect("localhost", "root","TWINKLE1"); //mysql_select_db("c1_cattle_history",$db); //$sql = "INSERT INTO cattle_rec (cattle_name,first_svc,second_svc,third_svc,calving_date,calf_sex,days_in_milk,milk_yld,dry_days,305_days_yld) VALUES //('$cattle_name,$first_svc,$second_svc,$third_svc,$calving_date,$calf_sex,$days_in_milk,$milk_yld,$dry_days,$days_yld')"; //$result = mysql_query($sql); require($_SERVER["DOCUMENT_ROOT"]."/dairy_logon.php"); $connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting"); mysql_select_db("$db_name"); mysql_query("INSERT INTO cattle_det (cattle_n,first_s,second_s,third_s,calving_d,calf_s,days_m,m_yld,dry_d,d_yld) VALUES ('$_POST[cattle_name]','$_POST[first_svc]','$_POST[second_svc]','$_POST[third_svc]','$_POST[calving_date]','$_POST[calf_sex]','$_POST[days_in_milk]','$_POST[milk_yld]','$_POST[dry_days]','$_POST[days_yld]')"); echo "Cattle Information Updated Successfully !\n"; } else { // display form } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <table cellpadding="0" cellspacing="0" width="99%"> <tr><td align="center"> <font face="Franklin Gothic Medium" size="6" color="#FF8000">History Sheet</font></td></tr><br/> <tr><td align="left"><font face="Franklin Gothic Medium" size="4" color="#FF8000">Cattle Name : </font> <input type="text" size="15" name="cattle_name"></input><br/> </td></tr><br/> <table border="2" cellpadding="1" cellspacing="0" id="mytable"> <tr> The code given above is supposed to retrieve values from a form and update the respective columns in the MySQL database,but everytime I key-in the value and say "Submit" in the form the form is just reset and the values are also getting updated. Please do provide your valuable inputs. Thanks a mil. Satheesh P R
  3. Hi All, Whenever I try to update any piece of PHP code to update a MySQL database, nothing happens. I have tried copying in some of the working codes of a website and tried the same, but no success. I recently installed XAMPP. I am connecting using the correct user id and pass to the database. The scripts are not giving me any error, but just not connecting, that's all. While making such a usage as noted below <FORM name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" > I get the following error Firefox can't find the file at /C:/xampp/htdocs/="<?php.. so on Why does this happen? I am pretty new to this, so please do help. Thanks, Satheesh P R
×
×
  • 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.