Jump to content

Varma69

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

About Varma69

  • Birthday 10/31/1982

Profile Information

  • Gender
    Male

Varma69's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Mchl thanks man it was the string quotes I got it to work. I changed the combo box to a normal text box also. Thanks a lot
  2. Okay so i tried just hard coding the variable in the query $query ="SELECT * FROM incidents WHERE inc_driverpermit='.qw.'"; //query set up And got nothing but a a blank page being displayed
  3. sorry about the incorrect code tags. It not working......I just using the an actual value in the sql statement and it says Unknown column 'permit number here' in 'where clause'
  4. Hi am havign a problem where I want to return results based ona combo box where the values are generated for a table and when you make a selection it take that value and returns all results based on the value selected. here is the code. combo select <code> <form action="RecordView.php" method="POST"> <?php require ("dbconnect.php"); $query2 = "SELECT * FROM incidents"; $result = mysql_query($query2) or die (mysql_error()); ?> Please select where you would like to go:<br/> <select name="cmbper" id="cmbper"> <?php While($row=mysql_fetch_assoc($result)){ printf("<option value = %s> %s </option>", $row['inc_driverpermit'], $row['inc_driverpermit']); }//end..while ?> <input type="Submit" name="Submit" value="GO"> </form> </code> Record View <code> <?php require ("dbconnect.php"); // retrieve all the rows from the database $cmbper=$_POST['cmbper']; echo $cmbper; $query ="SELECT * FROM incidents WHERE inc_driverpermit=".$cmbper.""; //query set up $results = mysql_query($query,$db) or die (mysql_error()); //executes query if(mysql_num_rows($results) > 0) { ?> <table border="1"> <tr> <td>Location</td> <td>Date</td> <td>Police Badge</td> <td>Vehicle Number</td> <td>Vehicle Make</td> <td>Vehicle Model</td> <td>Vehicle Colour</td> <td>Driver Frist Name</td> <td>Driver Middle Name</td> <td>Driver Last Name</td> <td>Driver Permit</td> <td>Driver Permit Expiry</td> <td>Insurer</td> <td>Insurance Expiry</td> <td>Notes</td> <td>Type</td><!--table data last column--> </tr> <?php // print out the results while( $row = mysql_fetch_assoc( $results ) ) { // print out the info printf("<tr> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr>", $row["inc_location"], $row["inc_datetime"], $row["inc_policebadge"], $row["inc_vehiclenum"], $row["inc_vehiclemake"], $row["inc_vehiclemodel"], $row["inc_vehiclecolour"], $row["inc_driverfirstname"], $row["inc_drivermiddlename"], $row["inc_driversurname"], $row["inc_driverpermit"], $row["inc_driverpermitexpiry"], $row["inc_insurer"], $row["inc_insuranceexpiry"], $row["inc_notes"], $row["inc_type"]); } } ?> </code>
  5. I read somewhere that php has changed it quoting rules either 'from or for' the 4.3 version. Not sure but i think it could be something with that.
  6. You need to POST the email first. eg. $email=$_POST['email']; $newsletter = "INSERT INTO newsletter (email) Value ('$email')"; $rst = mysql_query($newsletter) or die("Could Not Insert"); [\code] The last line of code the "or die" statement could be removed, I use it to know if i have a problem with my queries
  7. thanks the php worked thanks a million. Still working on the validation for it
  8. is there a javascript i can use
  9. ok thanks i will try it if i need any more help i will send the code. BTW do you know any good tutorials in to validate the field so when some one choose the month the correct number of days shows up in the Day drop down menu.
  10. Hi Guys I am have registration form with the date of birth field as a single text box but some user were not entering the format of the date of birth correctly. I decided to change from a single text bow to three drop down menu. What I would like to know is it possible to get these three values to be inserted into the database as one value. eg 1982/12/30 If it is can some one help me with it.
  11. thanks guys am kinda new to this php and posting in forums so i should use the [code][\code] so you will know exactly where the code starts and ends going to try it out now thakns again[/code]
  12. I am doing writing a script that updates an attribue in the database where the attribute needs to be updated by a value of 1. eg. NoEnrolled = 12 when the script runs the number enrolled should say 13 This is the script that i am currently using but not getting it to update <?php   $query3 = "SELECT * FROM Class Where ClassId='".$ClassId."'";   $result3 = mssql_query($query3, $db) or die ("Error with Query2");             while($row2=mssql_fetch_array($result3)){         $space = $row2['NoEnrolled'] + 1;           $query5 = "UPDATE Class SET NoEnrolled =".$space." WHERE ClassId='".$ClassId."'";       mssql_query($query5) or die ("Error with Query4");     }//end..while   ?>
  13. I am creating a web site using Microsoft SQL Server 2005 and using php. before i used MYSQL and php and everything was fine but now i need to know how to change the connect code from the one i use with mysql to work with Microsoft SQL Server 2005. here is the code i used first can someone show me the modification i need to make. <?php $db = mysql_connect("localhost", "root","") or die ("Connection to the db died"); mysql_select_db("lis",$db) or die ("connection to lis db died"); ?>
×
×
  • 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.