death_oclock 103 Posting Whiz

I have never seen this sort of thing and its hard to imagine C++ would include such a feature. Just for curiousity's sake, could you provide a link to where you found this example? And AncientDragon is right, you need to call strtok() multiple times.

death_oclock 103 Posting Whiz

Does the text overflow the width of the paragraph? Let me know if there is any CSS that would affect the <td> or the <p>.

death_oclock 103 Posting Whiz

Have you tried setting the width of <td> to an actual value? <p> tags should word wrap automatically if the width is specified.

death_oclock 103 Posting Whiz

In here:

<td width=""><p><?php echo nl2br($message); ?></p></td>
death_oclock 103 Posting Whiz

Apart from it you can initiate a char array and then get the input through simple scanf() function.

Scanf can look simple, but it actually does a lot of work under the hood which obviously will slow down your code. Also, it can cause lots of problems if you don't know exactly how it is matching input. It seems like a good idea at first but it is generally regarded as bad coding practice in most cases.

death_oclock 103 Posting Whiz

fgets to get the string, strtok to tokenize it. To do this multiple times, just put your code inside the body of a loop.

death_oclock 103 Posting Whiz

That's a sensitive thing to do

But the correct thing to do, as "\n" is a pointer, not a char. Comparison between a char and a pointer to a char cannot be expected to work properly (who knows what "properly" even means here?)

death_oclock 103 Posting Whiz

Learn database functions for whatever db server your client uses (MySQL, whatever). A tutorial on SQL statements and the php manual will help you with this.

death_oclock 103 Posting Whiz

EDIT: Sorry, Aia beat me to it.

death_oclock 103 Posting Whiz

Put this:

if (!$user_check) {
die('Invalid query: ' . mysql_error());
}

in between this:

$user_check = mysql_query("SELECT userdb_user_name FROM default_userdb WHERE userdb_user_name='$reciever'");

and this:

$user_check = mysql_num_rows($user_check);

and tell us what is displayed.

serdas commented: many thans. you were just great and patient +1
death_oclock 103 Posting Whiz

Can you explain that? I understand what Ancient Dragon did, but what about the "lock" concept?

death_oclock 103 Posting Whiz

mysql_fetch_array returns an array, just a the name implies, so this statement:

$new_Number_value = $query_results_Number++;

is trying to increment an array?
You want some thing like this:

$new_Number_value = $query_results_Number["Number"]++;
death_oclock 103 Posting Whiz

Do not use goto: in C applications. It is very bad coding practice (see spaghetti code). Instead, use control structures like conditional statements, loops, etc.

death_oclock 103 Posting Whiz

Then instead of setting the input variable to "18-2-21" (obviously not what csurfer intended), use fgets to get a line of user input. Also you could use sscanf() as long as you make sure to check its return value!

death_oclock 103 Posting Whiz

You can use a tm structure for the date of birth, convert it with mktime(), and subtract that from time(). Then convert your answer back into a tm struct.

death_oclock 103 Posting Whiz

Where exactly are you calling session_start()? And that error just means you have some sort of output (check for spaces, newlines before your <?php tags) before you have called session_start(). If you have to do this, consider output buffering.

death_oclock 103 Posting Whiz

A bubble sort but with the comparison flipped.

death_oclock 103 Posting Whiz

Good point. With both under your belt, not only will it strengthen your overall programming knowledge, the flexibility it would give you would be more impressive on a resume.

death_oclock 103 Posting Whiz

What is the problem with using || ? It is a completely valid part of the C language. There might be some obscure way of doing the same comparison without it, but it would be useless to even try it.

death_oclock 103 Posting Whiz

You're right, that's different from:

char sudoku[] = { '0', '0', '1', '0', '0', '0', '0', '0', '9',
                  '6', '0', '8', '7', '9', '4', '0', '2', '0',
                  '0', '0', '9', '1', '0', '5', '0', '0', '0',
                  '0', '0', '0', '6', '7', '0', '0', '0', '2',
                  '0', '8', '0', '0', '0', '0', '0', '6', '0',
                  '0', '9', '0', '4', '3', '0', '0', '5', '0',
                  '0', '0', '4', '0', '0', '0', '0', '1', '0',
                  '9', '3', '0', '0', '1', '0', '8', '4', '0',
                  '0', '0', '2', '0', '4', '3', '0', '0', '0' };

C will convert actual numbers into the ascii character at that index.
To get the char from a number:

char seven = 7 + '0';

Obviously that code is unecessary, but when working with variables it becomes useful.

death_oclock 103 Posting Whiz

Point taken, sorry.

death_oclock 103 Posting Whiz

If you have to use array notation, also consider using a static variable instead of a parameter:

void enter(int *p_arr)
{
  static int insert = 0;
  printf("\nplease enter the number:");
  scanf("%d", &insert);
  p_arr[i++]=insert;
}
death_oclock 103 Posting Whiz

There's a good reason why you're not supposed to feed the bears. If you give them something for free, they'll expect that all the time and won't figure out how to feed themselves. It would seem that people can be the same way...

death_oclock 103 Posting Whiz

You could use the WinAPI file functions (http://msdn2.microsoft.com/en-us/library/aa364232(VS.85).aspx) which allow you to set sharing permissions (as well as other flags and such for the sort of thing you described).

death_oclock 103 Posting Whiz

He didn't mean you should change it to 0, he meant thats what your code equated to. He meant you should either set or prompt for a product number. The first product in the display is still zero because you started your loops at 1, therefore skipping the 0th element of the array (the one that actually had a value). This is also why there are only 6 days in the week and 4 products.