mike_g 2 Newbie Poster

If I understand you right, then maybe a query like:

SELECT candidate FROM tablename WHERE team='$team'

Would pull a list/array of all candidates from a given team.

If I understand you wrong, then it might help if you could post your table schema.

mike_g 2 Newbie Poster

Like salem said, you would be better off with a decent compiler such as gcc. If its not a problem with your compiler, then I'd guess you are not linking the library properly. Its been a while, but I had a play around with libpng once I dumped the code here on my site. It should work assuming its linked and compiled correctly.

mike_g 2 Newbie Poster

You might want to take a look at strtok.

mike_g 2 Newbie Poster

Not quite. You just store an id indicating which stylesheet to load. When loading the page you would then check for the id in the cookie, and if the cookie does not exits use the default style. You could then have a switch/if statement which includes the correct stylesheet.

mike_g 2 Newbie Poster

Apparently when using z-index you are meant to specify an absolute position, but it also works with a relative position. Maybe try:

#logo{
        position: absolute;
	width: 100%;
	height: 80px;
	font-family: arial, verdana, sans-serif;
	font-size: 80%;
	background-color: #000000;
	z-index: 1;
}

#header{
        position: absolute;
	text-align: right;
	z-index: 2;
}

The display will probably be mangled, but your z-indexing should at least work. If you need to reposition your divs to make it look right specify offsets using top and left. If if absolute [positioning wont work have a go at using relative positioning.

Cheers.

Borderline commented: Achieved the goal +1
mike_g 2 Newbie Poster

Yes, but AFAIK it would require a little scripting. You could save the style in a cookie, then select a stylesheet based on the value when the page loads.

mike_g 2 Newbie Poster

It seems that you are not increment the id maybe add an increment to your loop? IE:

$id=1;
$count = mysql_num_rows( mysql_query("SELECT image_id FROM imagetable") )
$data = mysql_query("SELECT * FROM imagetable ORDER BY image_path ASC")
or die(mysql_error());
while($info = mysql_fetch_array($data)) 
{
    $sync = mysql_query("UPDATE imagetable SET image_id = $id ");
    $id++;
}
mike_g 2 Newbie Poster

Yes, but first you are going to have to learn how to read. You could practice with this. Then learn how to converse with other people coherently. Hopefully the reading material should help you with that too.

mike_g 2 Newbie Poster

>>You should be able to store the data for each card within an integer. You could >>then get the suit as card / 10 and you could get the rank as card % 10. I find this approach >>simplifies things a little.

Not getting this fully. The suit and the rank is where you lost me

Something like:

int card = 39;
char suit = (card / 10)+'A';
int rank = (card % 10)+1;
printf("suit: %c, rank: %d", suit, rank);

]I used fseek, fopen, fclose, etc but I seem to always do a pointer/memory violation as a popup window the red X pops up always when it gets to saving/opening. Some tips or pages with examples would be nice

IMO the easiest way to do this would be to load the entire file to ram, then overwrite the file when youre done. You could use fscanf to load the file content, and fprintf to print the output. Google should give you pleny examples of their usage.

mike_g 2 Newbie Poster

Since the result is a float I still reckon the easiest way to go about it would be to use sprintf and parse the string, but the op dosent seem to be interested in that idea :/

mike_g 2 Newbie Poster

If I was doing this I think I would use sprintf to convert the numeric result to a string then parse the characters building the words from it:
http://www.cplusplus.com/reference/c...o/sprintf.html

Have you tried converting the result to a string yet? that should make a good first step.

mike_g 2 Newbie Poster

You can connect to a database with any of those languages; not positive about vb.net, but I would expect so.

From your description it sounds as if youre developing a POS system, which is something I am currently doing. In which case I'd look mainly at how you are going to connect to the db and other hardware.

For a choice of language I'd go with whatever you know best and offers the best libraries for what you need. IMO C++ is not the most suitable language here as rapid devlopment would be more important than speed. I'm using Java & MySQL using spring & jpos.

Traicey commented: That was helpful, thanx man +1
mike_g 2 Newbie Poster

You should be able to store the data for each card within an integer. You could then get the suit as card / 10 and you could get the rank as card % 10. I find this approach simplifies things a little.

You could then have an array size 40 to hold the cards, which would be shuffled when you start the game.

Instead of passing structs around between the deck an the players you keep an index of the stack position in the deck. Every time you deal a card copy the card value at the stack position to the players hand and increment the stack position. When you reach the end of the deck the you can reshuffle the cards or something.

Heres crude example of how to get a random number:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
	srand(time(NULL)); 		//seed randomisation only once at start of game

        printf("Random number (0 - 39): %d\n", rand() % 40); // print a random umber
	return 0;	
}

A simple way to time the game would be to call clock() at the start of the game and save the return value. At the end of the game call clock again and subtract the start time from the end time. You then might want to convert the result tom minutes and seconds.

To write to files look up fopen and fprintf.

mike_g 2 Newbie Poster

If I was doing this I think I would use sprintf to convert the numeric result to a string then parse the characters building the words from it:
http://www.cplusplus.com/reference/clibrary/cstdio/sprintf.html