Jump to content

didgydont

Members
  • Posts

    115
  • Joined

  • Last visited

Everything posted by didgydont

  1. Thank you what you suggested did not work for me but you pointed me in the right direction mysql_query("SELECT * FROM jobs INNER JOIN statuses ON jobs.status=statuses.id WHERE statuses.completed = '0' ORDER by jobs.duedate");
  2. hi all I have two tables on a job board 1st table like so "custid,customer,duedate,statusid" the status is just an id wich refrences the second table 2nd table "statusid,stutus,hidden,completed" at the moment i have select * from jobs then if (!functiontocheckifcomplted($row[statusid])==true) { then display stuff here } but it still reads evey mysql job is there a better way to do this ?
  3. Yes yes it is. Thank you very much had been trying to ages to work it out. For such small and tidy funtction its difficult to get whats going on :-\. Once againg thank you very much.
  4. Hi all This probarly looks really bad but im trying to replase tags that change. So far it only replaces the last tag and not well either. I will try to show you function testfunc($value) { if ($value=='gallery'){$return .= "this gallery has worked = --$value--";} if ($value=='email'){$return .= "this email has worked = --$value--";} return $return; } $test = "this is a test {%email%} message {%gallery%} rtfgdsfgdsfg"; $test = preg_replace("#(.*){%(.*?)%}(.*)#is",'$1' . testfunc('$2') . '$3', $test); echo $test; this outputs this is a test {%email%} message rtfgdsfgdsfg but im trying to get this this is a test this email has worked = --email-- message this gallery has worked = --gallery-- rtfgdsfgdsfg Im sure im way off but I hope you can understand. Thank you for taking the time to read this post.
  5. thank you $query = "SELECT type, EXTRACT(YEAR FROM date) year, EXTRACT(MONTH FROM date) month, SUM(Cost) FROM Income where type='income' GROUP BY Year(Date), Month(Date) ORDER BY Date DESC"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo $row['year'] . "-" . $row['month'] . "-" . $row['type']. " - $". $row['SUM(Cost)']; echo "<br />"; }
  6. hi all im trying to display monthly totals but i cant get it to display the the year or month $query = "SELECT type, SUM(Cost) FROM Income where type='income' GROUP BY Year(Date), Month(Date)"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo $row['Date'] . "-" . $row['type']. " - $". $row['SUM(Cost)']; echo "<br />"; } i get this back -income - $360.00 -income - $390.00 -income - $150.00 -income - $150.00 -income - $1140.00 -income - $680.00 -income - $990.00 -income - $780.00 -income - $805.00 -income - $480.00 -income - $480.00 -income - $678.75 -income - $540.00 -income - $1260.00 -income - $1150.00 -income - $710.00 -income - $120.00 no month or year at front i have tried a few other things like $query = "SELECT type, SUM(Cost) FROM Income where type='income' GROUP BY DATE_FORMAT(`Date`, '%Y %m')"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo $row['DATE_FORMAT(Date)'] . "-" . $row['type']. " - $". $row['SUM(Cost)']; echo "<br />"; } still no luck any ideas ?
  7. Hi all Im sending a dynamic created pdf file with php. It gets flagged as spam are things that can be done to help prevent this ? didnt really know where to post it.
  8. hello all i have tried searching and wouldnt know where to begin. basicly i need to preg replace a string but i need to make it like so if string was this "test this string ~~getthisvalue/~~ test" basicly i want to signal a start ~~ and an end /~~ and get and replace the value between with a the value that corrisponds. maybe like ~~1/~~ and 1 might = <img src="test.jpg"> and ~~2/~~ 2 might = company name i hope i have made myself clear
×
×
  • 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.