Jump to content

vanvoquan

Members
  • Content Count

    47
  • Joined

  • Last visited

Community Reputation

0 Neutral

About vanvoquan

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  1. Thanks Barand, the one you wrote above is what I have and i works perfectly. But i'm talking about another query because i also need SUM(sale+tip) for today of all the technictians. The one you wrote only give me the sum(sale+tip) for today only for one technictian, not all of them so that why I created another query but it's not working. $query1 = "SELECT SUM(sale + tip) as totals FROM everyday_sale where DATE(s.reg_date) = CURDATE()"; $result1 = mysqli_query($query1); And got this message Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\AppServ\www\usnailsandspa\tod
  2. Thanks everyone for the inputs, try to replace mysql_query with mysqli_query and still not working. I can not get the output data from the database. I also got this message: Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\AppServ\www\usnailsandspa\today_earnings.php on line 68 Invalid query: Whole query: SELECT SUM(sale + tip) as totals FROM everyday_sale where DATE(s.reg_date) = CURDATE()
  3. Hi every one, I have play with this code for a whole day and still can not get it working. Any helps will be appreciated and will give donation. Thanks in advance <?Php $connection = new mysqli('localhost', 'root', 'Mylovev1@', 'usnailsandspa'); if ($connection->connect_errno > 0) { die ('Unable to connect to database [' . $connection->connect_error . ']'); } $query1 = "SELECT SUM(sale + tip) as totals FROM everyday_sale where DATE(s.reg_date) = CURDATE()"; $result1 = mysql_query($query1); if (!$result1) { $message = 'Invalid query: ' . mysql_error() . "\n"; $mess
  4. Thanks Barand. After fixing the code, it displays all the technictians but not the sum of sales for that technictian.I think the data did not showing because we didnt give them the technictian_id. Here is the two table i got Table technictians: id, firstname, lastname, etc Table everyday_sale: id, technictian_id, sale I think we have to write something like : where technictian_id = '.$row['id'].' maybe? And are you accepting paypal for donation? Below is my updated code <HTML> <HEAD> <TITLE></TITLE> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.1
  5. Thanks Barand for quick replying. I put your new code in it give the the id and the name but not the SUM of sale in "<tr><td>'.$row['SUM(sale)'].'</td></tr>". Also it only displays the first technictian instead of all the technictians. Did i missing something? Below is the updated code <HTML> <HEAD> <TITLE></TITLE> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="onpage_submit.js"></script> <META name="description" content=""> <META name="keywords" content=""&
  6. Hi, i'm new to php and mysql so any helps will be greatly appreciated. I have the the code below but it looks like it's not working. I need the data id, firstname from table technictians and the total sales(add all sales in the database together) in the everyday_sale table. It's give me the total sale in the second query but not the id and firstname from the first query. If i take out the second query then the first query gave me the id and firstname just fine. It's seem like that two queries dont like each other some how. Thanks in advance and will consider give donation if got the problem so
×
×
  • 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.