Hello,
Whenever I start a new project, I am sometimes perplexed in data processing.
I am, actually, dumping the old project and start a new project again.
Dumping and Starting again several times…
[b]myTable[/b]
n
10
I have “myTable” like the above.
The table has just one column named “n”.
The table has just one record.
The record has a numeric value “10” for the column “n”.
[b]code[/b]
<?php
$query="select n
from myTable";
$sql=mysql_query($query);
$row=mysql_fetch_assoc($sql);
$mysql_query=("INSERT INTO myTable ( n ) VALUES ( 20 ) ");
exit([COLOR="#FF0000"]$row['n'][/COLOR]);
?>
[b]result[/b]
10
I have the PHP code above in one of my pages.
DB connection code is before the code above.
The browsing result of the code above is “10”.
That means DB connection is correctly working.
But the data “20” for the column “n” is not inserted.
What’s the problem in my data inserting code above ?
Why is the data “20” not inserted (in your thinking or guessing) ?
How can I insert the data “20” to myTable?
I am in perplexed at the moment.