Yeah I know, this is simple High School stuff, but I must have skipped that day.
$unit_cost = "45.00";
$selling_price = "52.45";
$the_markup = ???; // Need percentage of markup here
Embarrassingly thankful for any help.
thanks for the "thoughtful db query"
some of us, however, may not know there was even such a query available, until someone like yourself shares their knowledge.
as you just did.
thanks.
PERFECT! What a great function.
This worked as I wanted:
<?php echo date("F j, Y, g:i a", format_data($row_Recordset1['when_it_happened'])) ?>
Thanks! This one will be going in my library for sure.
The Problem:
I am retrieving a timestamp field from a mySQL database running on Apache. I am trying to take this timestamp, and within PHP convert it to something actally readable.
The record is being returned as follows:
mysql> select last_updated from hours where project_id =2...
The thing is, the user can change the email, so thats why i used those weird ::variables:: so i can easily replace them with data from the data source.
Ok here it is in context:
In a database there is a string like this:
On ::date:: we worked on project ::project name:: and spent ::hours worked:: on it. ( etc ).
Is it possible to have an array of the things we are looking to replace in the string ( the ::variable:: ) and yet ANOTHER array of...
NEVER MIND I AM AN IDIOT!!!!!!!!
Can you see it?
function getProjectInfo($projectId){
// Retrieve info for supplied project ID
// Returns $row
$page_sql = "SELECT * , total_hours-hours_paid AS hours_owed, DATE_FORMAT(last_updated, '%m-%d-%Y') AS last_update FROM `project` INNER JOIN...
I was assuimg a lot in my last post. I will be more specific.
1. My connection is included via:
<? include ("includes/config.php") ?>
I don't know. I was just trying it.
In reality, my SQL is a lot longer and does return rows (as confirmed by Navicat). So for the sake of this example...
This simple example does not work:
function getProjectInfo($projectId){
global $row;
// Retrieve info for supplied project ID
// Returns $row
$page_sql = "SELECT * from myTable";
$result = mysql_query($page_sql);
$row = mysql_fetch_array($result);
return $row;
}...
Thanks, I have gotten that far.
Let's assume on each row there are appropriate field names, such as client[] , project[], etc.
when i go to update ALL these records, how do I loop through each one?
Just psuedocode is needed, nothing specific.
For instance, I am sure it is something like...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.