//If HTTP Protocol POST is invoked then store form data in local variables and UPDATE the homepage table with the values.
if(isset($_POST[ update ]))
{
$Id = $_POST[ Id ];
$title = $_POST[ title ];
$content = $_POST[ content ];
// update the article in the database
$query = "UPDATE main_page SET title = $title - content = $content ";
mysql_query($query) or die( Error : . mysql_error());
echo "Article $title updated";
}
Error : 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 this is the north s website at line 1
Hi.
I m going to build a high scale site in php/mysql that needs to scale horizontally.
What things should the developer do and not do when writing the code and creating the database?
Thanks.
I want to make a blog and I should want to add a comment box too. What I can do. I know how can I create a form. I know to crate databases and tables. but I don t know how can we store comments. Do I want to create 1 column for 1 comment? Then If there 10 comments I want to create 10 columns. but that is not possible because i want to create 1 form for 1 comment. Then where can I store the comments. Please give the answer..please....
This might be a little difficult to explain but I ll try.
In MySQL I have a table like so:
id INT(3) PRIMARY KEY NOT NULL AUTO_INCREMENT-
name VARCHAR(255)-
code VARCHAR(255)-
subclass_id INT(3) NOT NULL DEFAULT=-1
So I have a bunch of records in my table like so
1- "UK"- "UK"- -1
2- "England"- "EN"- 1
3- "Wales"- "WA"- 1
4- "Scotland"- "SC"- 1
5- "ASIA"- "AS"- -1
6- "India"- "IN"- 5
7- "China"- "CN"- 5
8- "Pakistan"- "PK"- 5
9- "Afghanistan"- "AF"- 5
10- "Northern Ireland"- "NI"- 1
.. etc ..
OK- so you may have figured out how it works - the Top level categories which are like continents/kingdoms are denoted by -1 in the subclass_id meaning they are not subclassed. But countries within the continents are subclassed by the id of the continent they come from - e.g. India is in Asia (5).
Now my question is- how do I write one SQL command that will show the top level continents with the countries in them in an ordered list like so:
Continent
Country
Country
...
Continent
Country
...
how can i make a log in sytem on my website- Any easy ways. Or do i have to learn asp/mysql stuff?
No comments:
Post a Comment