ShawnCplus 456 Code Monkey Team Colleague

date(). php.net/date. Google is your friend.

ShawnCplus 456 Code Monkey Team Colleague

Good answer. I solved my problem too.

I'm sure he heard you. By the way, can I borrow your necronomicon so I can resurrect the dead as well? Come on, this thread is over 5 years old

vaultdweller123 commented: bwahahaha LMAO XD +6
ShawnCplus 456 Code Monkey Team Colleague

I did come across that a couple times when I was looking around earlier. That's not actually a php function though is it? I'll look into it. Thanks a lot.

No, it's a program separate of PHP altogether whose purpose is to schedule tasks

ShawnCplus 456 Code Monkey Team Colleague

Cron is what you're looking for. Give it a google and have fun.

ShawnCplus 456 Code Monkey Team Colleague

Also, your last if statement in your snippet will always be true, you only used one =

ShawnCplus 456 Code Monkey Team Colleague

What the heck? Why did you do this?

const double pi = 3.1415926535;
const double Pi = 3.1415926535;
const double pI = 3.1415926535;
const double PI = 3.1415926535;

What were you trying to accomplish?

ShawnCplus 456 Code Monkey Team Colleague

The error PHP gives you essentially tells you EXACTLY what to do already. Remove the errant end comment which I pointed out in my snippet

ShawnCplus 456 Code Monkey Team Colleague

A), use [code] tags
B) Don't nest comments (If you would've used code tags you would have seen the error, or you could just use an editor that actually highlights your code)

/* case 'latestnews':

/**

* Show latest news for My Blog

**/

if(cmsVersion() != _CMS_JOOMLA15)

$title = "Latest updates";

showLatestNews();

break;*/
ShawnCplus 456 Code Monkey Team Colleague

how to display a string in php without using echo command??
plz do reply me

Make your own thread, don't revive 4 YEAR OLD THREADS.

ShawnCplus 456 Code Monkey Team Colleague

No problem, just study-up and you'll have the concepts down in no time at all

ShawnCplus 456 Code Monkey Team Colleague

Well it'd be enter operation, enter first number, enter second number -> switch(operation) { calculate answer } -> output answer -> done

EDIT: This is my 1000th post, wooo!

ShawnCplus 456 Code Monkey Team Colleague

Ok, then yeah, follow the instructions. And you only have to worry about dividing BY zero, it doesn't matter if numerator is zero, only check the denominator (secondNum in this case)

ShawnCplus 456 Code Monkey Team Colleague

why would you have to swap for subtraction? Also, you're not checking to make sure that you're not dividing by zero in your division section

ShawnCplus 456 Code Monkey Team Colleague

As a side note, do you notice that you have a lot of repetitive code? That usually means it can be taken out and put in one place. Everything inside the if/else blocks does exactly the same thing except the answer = part. So take out the cout/cin, drop it above and then use a switch statement. Take a look in your book for the switch statement syntax.

ShawnCplus 456 Code Monkey Team Colleague

Ya can't just put braces in random spots and expect it to work :)

//Ch6AppE08.cpp
//Displays the answer to arithmetic problems
//Created/revised by Greg Schader on 6/22/2009

#include <iostream>

using std::cout;
using std::cin;
using std::endl;

int main()
{ 

  //Define variables
  char function = ' ';
  int firstNum = 0;
  int secondNum = 0;
  int answer = 0;

  //Enter variables and perform operation
  cout << "Enter the letter of the operation you wish to perform: ";
  cin >> function;

  if (toupper(function) != 'A' && toupper(function) != 'S' && toupper(function) != 'D' && toupper(function) != 'M') {
    cout << "That letter is not valid." << endl;
  } else {
    if (toupper(function) == 'A') {
      cout << "Enter the first number of the operation: ";
      cin >> firstNum;
      cout << "Enter the second number of the operation: ";
      cin >> secondNum;

      answer = firstNum + secondNum;

      cout << "Answer of operation is: " << answer << endl;
    } else if (toupper(function) == 'S') {
      cout << "Enter the first number of the operation: ";
      cin >> firstNum;
      cout << "Enter the second number of the operation: ";
      cin >> secondNum;

      answer = firstNum - secondNum;

      cout << "Answer of operation is: " << answer << endl;
    } else if (toupper(function) == 'M') {
      cout << "Enter the first number of the operation: ";
      cin >> firstNum;
      cout << "Enter the second number of the operation: ";
      cin >> secondNum;

      answer = firstNum * secondNum;

      cout << "Answer of operation is: " << …
ShawnCplus 456 Code Monkey Team Colleague

When you fix something don't just say it didn't work and wait for another answer, post the updated code

ShawnCplus 456 Code Monkey Team Colleague

Going directly to the documentation usually helps:
http://dev.mysql.com/doc/refman/4.1/en/user-account-management.html

ShawnCplus 456 Code Monkey Team Colleague

Don't forget the braces around your inner if and else statements, take a look in your book on why to do this (if it explains it)

ShawnCplus 456 Code Monkey Team Colleague

Well do you want the SQL syntax or do you want to know how to do it in C++ because you need separate libraries to do things like that in C++ (If I had to recommend one I'd suggest SQLite)

ShawnCplus 456 Code Monkey Team Colleague

You could try using $_SERVER['HTTP_REFERER'] but I'm not 100% sure on that.

ShawnCplus 456 Code Monkey Team Colleague

When using mysqli procedurally the database link comes first, then the query. Please read the documentation when you get errors like this

ShawnCplus 456 Code Monkey Team Colleague

Sorry. Yes i have.

Select * from table1 Where myid='PO-1-09/09';

Also, Like and IN don't work as well.

Like I said, what is the data type for that field?

ShawnCplus 456 Code Monkey Team Colleague

You have to encode the brackets < >, otherwise they're interpreted as HTML tags and wont display to the browser.

ShawnCplus 456 Code Monkey Team Colleague

If 'desc' is a FULLTEXT field instead of a VARCHAR field then you have to use MATCH <field> AGAINST ('<string>') instead of LIKE IIRC

ShawnCplus 456 Code Monkey Team Colleague
<a href="blah" title="This is your title">some link</a>

You answered your own question

ShawnCplus 456 Code Monkey Team Colleague

div matches a div tag, p matches any p tag under a div and * matches anything under the p tag. It's called CASCADING Stylesheets for a reason.

ShawnCplus 456 Code Monkey Team Colleague

Well whether you're using a GUI or not you're writing HTML. And GUI is a very broad term, I'm pretty sure your teacher meant WYSIWYG. Go google WYSIWYG and you'll have your answer. Future note: use Google before asking your homework questions here

ShawnCplus 456 Code Monkey Team Colleague

We have a Linux forum, please post your question there. http://www.daniweb.com/forums/forum111.html

ShawnCplus 456 Code Monkey Team Colleague

As always make sure that $looky is what you think it is by var_dump ing it. Also, manually look in the database to make sure that record is actually there.

ShawnCplus 456 Code Monkey Team Colleague

hopefully you have a WHERE clause in that query and what is the datatype of that field?

ShawnCplus 456 Code Monkey Team Colleague

MySQL Query Browser directly from MySQL http://dev.mysql.com/downloads/gui-tools/

ShawnCplus 456 Code Monkey Team Colleague
ShawnCplus 456 Code Monkey Team Colleague

ECMA-48 SGR sequences are used for (somewhat) portable termal color. http://en.wikipedia.org/wiki/ANSI_escape_code#graphics

ShawnCplus 456 Code Monkey Team Colleague

Well I can tell you right now that it won't be able to directly interact with the device because that involves having access to the user's computer which is not possible with PHP unless it is running on the same machine.

ShawnCplus 456 Code Monkey Team Colleague

This should be in the HTML & CSS forum, this doesn't have anything to do with PHP.

ShawnCplus 456 Code Monkey Team Colleague

Google is your friend. They're called lightboxes. Lightbox, thickbox, tightbox are all examples of libraries that have already been built to create modal dialogs.

ShawnCplus 456 Code Monkey Team Colleague

Search the forums for AddHandler

ShawnCplus 456 Code Monkey Team Colleague

Online information system?
That could be anything from a private blog to a Google sized search engine.
Could you possible be more vague? :)

I would also have to say yes to PHP.

P.S.
If you want a unbiased opinion, it's probably best to not ask in a language specific forum :icon_wink:

Are you implying that I'm biased? (hint: I am :) )

ShawnCplus 456 Code Monkey Team Colleague

Thanks for the useful solution to my problem!

Since starting this post, I have changed the way my shapes are represented. Instead of having a separate class for each shape, I have one unified class that stores the vertexes of a given shape as offset vectors in an array. This way, I can have one class represent any arbitrary shape.
So now, I only need one function to draw a shape, since all the information necessary to draw it is stored inside the class.

Nevertheless, I think it's interesting to argue about a way to achieve dynamic polymorphism outside of classes.

PS: I can't quite figure out how to decode your signature. Do the pluses represent increments? Are the <> signs for shifts or character separators? Are they characters themselves?

haha, so you've gone from trying to correctly implement polymorphism to ignoring it entirely? *shrug* I guess that's your choice.

My signature is geekcode

ShawnCplus 456 Code Monkey Team Colleague

Hi,

I have the following query, which does not return any results.

select (sum(t.minutes) / 60),d.fiscalmonthnum from kpifntime t
	inner join kpiddate d on t.datekey=d.datekey
	inner join kpidacts a on t.activitykey=a.activitykey
	inner join kpidfees f on t.feeearnerkey=f.feeearnerkey	
where a.activitycode in (11,12,13,14,15,16,17,18)
and d.fiscalmonthnum=11
and d.fiscalyearnum=2009
and t.feeearnerkey=520
group by fiscalmonthnum;

If the sum of t.minutes does not return a result, I need the query to return the integer 0.

I've tried this using the IFNULL() function, but I don't think this is correct as the result being returned from the query is not null, just blank.

Any ideas guys?

As far as I know there's no way to halt a SELECT statement mid-query. You'd either have to write a stored procedure or have whatever language you're using to interact with MySQL handle this logic.

ShawnCplus 456 Code Monkey Team Colleague

You're wrong. What you're describing is a graphics class. I have that, it's a simple layer I wrote on top of OpenGL. That class just takes in data (vertexes) and outputs it to the screen. What I want form my drawer class is to decypher the data from my shape class and pass it to my graphics class.

It's just down to semantics now since what you're describing can't really be called a 'Drawer' class since it's not 'Drawing', it's more of a GraphicsDriver. Name it what you wish but you have the right idea.

ShawnCplus 456 Code Monkey Team Colleague

"online information system" is unbelievably vague so I'll answer yes.

ShawnCplus 456 Code Monkey Team Colleague

I got a copy from my local library. If yours does not have it, they can likely order it from some other library. Amazon has it online. However, there are SO many books in this category (good and bad) that I prefer using them a bit before I actually buy them.

4 YEAR OLD BUMP, for the love of all that is benevolent and good in this world READ THE DAMN DATE before posting.

ShawnCplus 456 Code Monkey Team Colleague

PHP does not work like C/C++. When a page refreshes its previous state is gone, it has no knowledge of what happened before. You must save variables if you want to carry them across pageloads with either a database, sessions, cookies or files.

ShawnCplus 456 Code Monkey Team Colleague

So if those errors you got are EXACTLY the errors you got then you need to trim() the $fname variable. It looks like it's ending in a carriage return.

ShawnCplus 456 Code Monkey Team Colleague
ShawnCplus 456 Code Monkey Team Colleague

echo $fname to make sure it's actually the value you think it is, also b as far as I know is not a valid fopen flag. http://php.net/fopen

ShawnCplus 456 Code Monkey Team Colleague

Simple fix, don't use IIS. Get XAMPP or WAMP. Also, in your php.ini file try not specifying "C:" just put "\PHP\ext\php_mysql.dll"

ShawnCplus 456 Code Monkey Team Colleague

Google is your friend, we're not doing your homework for you.

ShawnCplus 456 Code Monkey Team Colleague

Not to take over this guy's thread, but a question about syntax of Templates, is there any real difference between <class T> and <typename T> ?

nope, no difference. class was in the original specification by Bjarne, typename was later added to avoid confusion. (I personally use typename)