I removed the comments (they were just for fun there, and with enters it actually looked more structured) and it didn't seem to work, still the same error. I google'd a few times and searched through the mysql documentation but I didn't found anything that solve's this. Any help is highly appreciated. Here is the query again, and this time better formatted :) :
[code]--
-- Database: anonymusiusform
--

CREATE DATABASE anonymusiusform DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE anonymusiusform;

--
-- Table structure for table enquete
--

CREATE TABLE IF NOT EXISTS enquete (
id int(5) NOT NULL auto_increment,
ip varchar(16) NOT NULL,
host varchar(50) NOT NULL,
age varchar(2) NOT NULL,
name varchar(50) NOT NULL,
rank varchar(8) NOT NULL,
opmerking text NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;[/code] I traced the enter problem down to me not enabling javascript because the site is dogslow (for me) with javascript enabled. So again sorry for my previous post.

I have a program which requires a database. So I made a file that could generate the sql to create it (I copied the sql from PHPmyadmin as reference). When I execute the sql I get the error: [code]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; USE anonymusiusform; -- ------------------------------------------------' at line 4[/code] It's always on the first ; that the error occurs. If I execute it in PHPmyadmin it works and correctly creates the database. I think the problem lays with the 'delimiter'. I tried googling it but I didn't found anything to solve my problem. This is the sql my file generate┬┤s: [code]-- -- Database: anonymusiusform -- CREATE DATABASE anonymusiusform DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE anonymusiusform; -- -------------------------------------------------------- -- -- Table structure for table enquete -- CREATE TABLE IF NOT EXISTS enquete ( id int(5) NOT NULL auto_increment, ip varchar(16) NOT NULL, host varchar(50) NOT NULL, age varchar(2) NOT NULL, name varchar(50) NOT NULL, rank varchar(8) NOT NULL, opmerking text NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;[/code] Any help would be highly appreciated. [B]Edit[/B]: The layout seems messed up, I don't get what's wrong. Sorry about it. It doesn't seems to recognize enters anymore.

You misspelled mysql_num_rows, I think that because of that it returned false, so 0. And because of that the entire while loop was never executed.

To shouldn't you get every result manually. I think you should do something like:

echo "<table>n<tr><th>Field</th><th>Value</th></tr>n";
foreach(mysql_fetch_assoc($result) as $key => $value)
{
echo "<tr><td>$key</td><td>$value</td></tr>n"
}
echo "</table>";

I didn't test it, but it should work (for one result, if there are more result you should format the table different).

Very sorry to bother you, I forgot to add [inlinecode]
[COLOR=#000000][COLOR=#0000bb]$this[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]free [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]true[/COLOR][COLOR=#007700];[/COLOR][/COLOR][/inlinecode] to the free function, and because of that the class tried to free the result again in the destructor.

Very sorry for the triple post. Feel free to delete this if you have the power to do so.

The code owrked when I took it appart, but when I added the mysql_num_row function it crashed:

[php]<?php
mysql_connect('localhost','anonymusius','fake password, so not my real one');
mysql_select_db('anonymusius2');

class query
{
var $query;
var $result;
var $free;

function query($query)
{
    $this->query    = $query;
    $this->free     = false;
    $this->result   = @mysql_query($this->query) or die('Error in mysql query:<br />\n' . mysql_error());
}

function __destruct()
{
    if($this->free === false){$this->free(); echo "You forgot to free the query result"; $this->free = true;}
}

function array_result()
{
    for($a = 0; ($b = mysql_fetch_array($this->result, MYSQL_ASSOC)) !== false; $a++)
    {
        $array[$a] = $b;
    }

    return $array;
}

function get_result()
{
    return $this->result;
}

function num_rows()
{
    return @mysql_num_rows($this->result) or die("Error in mysql_num_rows: " . mysql_error());
}

function free()
{
    @mysql_free_result($this->result) or die("Error while free-ing result.<br />\nMysql error: " . mysql_error() . "<br />\nObject info:<br />\n" . print_r($this, true));
}

}

$query = new query("SELECT style_name, style_path FROM style WHERE style_id='1'");
echo "Mysql_num_rows(" . $query->num_rows() . ");<br />\n";
print_r($query->array_result());
$query->free();
?>[/php]
and I got the error:

[code]Mysql_num_rows(1);
Array (
[0] => Array
(
[style_name] => Basic
[style_path] => basic
)
) Error while free-ing result.
Mysql error:
Object info:
query Object (
[query] => SELECT style_name, style_path FROM style WHERE style_id='1'
[result] => Resource id #3
[free] =>
)[/code]

I'm learning Object Orïented PHP (or whatever you like to call it) and I ran into a problem.

I made this query class:
[php]class query
{
var $query;
var $result;
var $free;

function query($query)
{
    $this->query    = $query;
    $this->free     = false;
    $this->result   = @mysql_query($this->query) or die('Error in mysql query:<br />\n' . mysql_error());
}

function __destruct()
{
    if($this->free === false){$this->free(); echo "You forgot to free the query result"; $this->free = true;}
}

function array_result()
{
    for($a = 0; ($b = mysql_fetch_array($this->result, MYSQL_ASSOC)) !== false; $a++)
    {
        $array[$a] = $b;
    }

    return $array;
}

function get_result()
{
    return $this->result;
}

function free()
{
    @mysql_free_result($this->result) or die("Error while free-ing result.<br />\nObject info:<br />\n" . print_r($this, true));
}

}[/php] When I execute it I got an error:

[code]Error while free-ing result.
Object info:
query Object (
[query] => SELECT style_name, style_path FROM style WHERE style_id='1'
[result] => Resource id #4
[free] =>
)[/code]

I don't understand what the error in the code is. I do know this class is mostly useless. It was more to train then to use. The error message if you don't free your query in the destructer is because I want to learn myself to free everything everytime, because some language's require that.

Well if you search for Anonymusius in images you get nothing, if you search for anonymous you get [URL="

you are right :sad:

Look! some billion pages marred because FUNNY google adsense!

Yes, some several BLOGS flooded by horrible google intellitxt

I once read:

There are 10 kind of people, those who know binary and those who doesn't

liked that one. Mine is not really original.

[quote=Ancient Dragon;289796]>>cout << "<input type="text" name="firstname"> " << endl;
That line is ill-formed. count the quotes and you will find that the word [B]text[/B] is NOT within quotes.
This is probably what you want
[code]
cout << "<input type=" << text << " name=" << firstname << "> " << endl;
[/code][/quote]I think he rather wants to escape the first quote's since there is no variable text and in HTML wouldn't it make a whole lot of sense to make varaible's on that place differ from time to time. To is differing of the formname's in HTML a bad idea. If you want to send the name with it in the form use hidden fields or something.
[code]
cout << "<input type=\"text\" name="firstname"> " << endl;
[/code]I think that's what you want

BTW, in HTML I thought it was better to end your input thing's with />, so that would make <input type="text" name="lol" />
If you wanted to set the textfield to the firstname it would be:
<input type="text" name="firstname" value="Default value, you should cout the firstname then here" />

cocktails are on their best when the mixture is perfect.

anymore cheese and I'm gonna throw up.

I'm from the Netherlands, the xth generation, but I put ketchup on everything (except on 'pomme frites', that's good with Mayonnaise ;))

with his evil

Did he said

[quote=The Dude;280232]That tastes eactly like red catchup to me anyways... Havent had too much of it though....[/quote]

It tasted different for me. I think you to taste with your vision and nose.

I only had it once, I like the red one more :P

I don't really care when your birthday is, I'm gonna wish you happy birthday anyway!

Happy birthday!

I mostly listen to rap, currently there are some nerd rappers who make so called "[URL="

You are currently using 232 MB (8%) of your 2786 MB.

Without spam, some attachments.

You can to see in the two posts below they sort of limited the space to 2786 MB :P

If I correctly understand what you say would that be:
[code]
int temp = system("last");
mystream << temp;
cout << temp;[/code]

You should at least ell what game your talking about. This is bound to make no sense to almost everyone.

[quote=goldeagle2005;276505]Whoop-de-do. I have GOT to learn that 'nothing in my pocket' trick. Next time I go out with my friends, pretend you're broke and get a free treat.[/quote]
You can to really take nothing with you, if your really cheap :P.

Try pressing shift + control, that works for me. I think it's some sort of shortcut to changing the keyboard.

You should say what the code is about, what is it supposed to do? What is there to sort and where to search in? I'm not gonna spend much time looking through code finding what the real problem actually is. You should describe the problem better.

And you really should indent it. I personally think it's just so much easier to understand for outsiders of your code.

I'm still looking for an legal version of girlfriend 1.0. I can't find an serial for the downloaded once:cheesy:.

[quote=~s.o.s~;272780]Just told them about the part Daniweb as a whole is playing in the development of kids... and all that.
Hope it should get them hooked on this one..[/quote]
What do you mean with that? I think that with my 15 I'm one of the younger people around here, do I fall by you under kids and is this helping my development? :P

What do you exactly mean with that?

[b]Edit[/b]: I to did the recomment thingy BTW

You should post in what language you are coding, and then post it in the forum for that language. This forum is, as far as I understand, sort of an off-topic forum about coding and software development.