Jump to content

Maclovin

New Members
  • Posts

    6
  • Joined

  • Last visited

Maclovin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Maclovin

    Hey!

    Hey i like the idea. i've been learning it off and on for a while too. i indeed need some help with a project im going to start working on the next week or so. i've posted about it but i would still seek some advice from you. thanks for your message.
  2. im guessing it has something to do with my database? i do have a service table where "serviecid" is a row in there.
  3. @Guru. i really appreciate your comments and will take everything into consideration on my continued work on this. i am not an advanced php coder so i knew i made a lot of mistakes. the whole aim is to produce a service bill and post the results to the relevant field names in that bill
  4. @Guru "Anyway, you can change those queries to show whatever error is displayed.This is just a quick example script to point you in the right direction. I would have more code for a real application." I tried your suggestion using the code you provided as a start and got the following error Query Failed! Query: {} Error: Unknown column 'serviceid' in 'where clause'Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'serviecid' in C:\xampp\htdocs\Vehicleworkshop\Vehicleworkshop\viewservicebill' at line 1
  5. @jayson_ph this is my dbconnection <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("vworkshop"); ?>
  6. I keep getting the following error Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in.... on line 7 in the code below: <?phpsession_start();include("header.php");include("sidebar.php");include("dbconnection.php");$result= mysql_query("select * from service where serviecid='$_POST[serviceid]'");$row1 = mysql_fetch_array($result);$result1= mysql_query("select * from customer where custid='$_POST[customerid]'");$arrrec2= mysql_fetch_array($result1);$dt = date("Y-m-d");if($_POST["vehstatus"] == "Completed"){ $sql ="insert into billing(serviceid,particulars,scost,date,paidstatus) values('$_POST[serviceid]','$_POST[particulars]','$_POST[vehcost]','$dt','$_POST[vehstatus2]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } $insid = mysql_insert_id(); mysql_query("UPDATE service SET status='$_POST[vehstatus]' where serviecid='$_POST[serviceid]'");}if($_POST["vehstatus"] == "Cancelled"){ $sql ="insert into billing(serviceid,particulars,scost,date,paidstatus) values('$_POST[serviceid]','Calncelled','0.00','$dt','Cancelled')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } $insid = mysql_insert_id(); mysql_query("UPDATE service SET status='$_POST[vehstatus]' where serviecid='$_POST[serviceid]'");}?> <div id="main"> <a name="TemplateInfo"></a> <?phpif($ctins == 1){ echo "<center><b>Employees account created successfully...</b></center><br>"; echo "<center><b><a href='emplogin.php'>Click here to Login.</a></b></center>";}else{ ?> <form id="form1" name="form1" method="post" action=""> <table width="494" border="1"> <tr> <th colspan="2" scope="col"><h1>E-Workshop</h1></th> </tr> <tr> <th height="40" scope="col">Bill No. : <?php echo $insid; ?></th> <th scope="col">Date: <?php echo $dt; ?></th> </tr> <tr> <th width="237" height="45" scope="col">Sevice ID: </th> <th width="241" scope="col"> <?php echo $_POST[serviceid]; ?></th> </tr> <?p ... ... ... to be continued. viewservicebillingreport.php
×
×
  • 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.