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...
...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 `hours` ON...
...reality, my SQL is a lot longer and does return rows (as confirmed by Navicat). So for the sake of this example, let's use:
$page_sql = "SELECT * from myTable where projectid = '$project_id' ";
Lastly, I am not getting any errors.
Could this be something in my $conn string not being...
...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;
}
and if I call it...
...each one?
Just psuedocode is needed, nothing specific.
For instance, I am sure it is something like this:
if($form_was_submitted){
/* Loop through all fields */
foreach( SOMETHING AS SOMETHING-ELSE HERE ) {
/* Get the Primary Key from Hidden Field
so I...
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.