kakingho
-
Content Count
53 -
Joined
-
Last visited
Posts posted by kakingho
-
-
<?php
$fp=fopen("test.txt","a");
fputs($fp,"ok");
?>
The above method is only to add "ok" at the end (DO NOT write on a new line)
I want to know...
How to add data on a new line and at the end of txt file??!
thx~
-
test.php
<?php$abc='123';include 'index.htm';?>
index.htm<table width="200" border="1"> <tr> <td>$abc</td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table>
it shows this pic
http://i19.photobucket.com/albums/b190/kakingho/abc.jpg
but i want to show this
http://i19.photobucket.com/albums/b190/kakingho/123.jpg
i want to separate main php codes in php file and main website structure in htm file~
how to do that?!
i dont want to type this in htm file, any other method??<table width="200" border="1"> <tr> <td><?PHP $abc; ?></td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table>
thx~Notice from BuffaloHELP:Please limit your picture's width to no more than 640px
-
I want to install whois system in my website in which my visitors can search other websites' information.I want to have php source code of it.Is it free of charge? What is the official website of WHOIS??!thx~
-
-
Your method is good to deal with large data.Not too hard:
print "<tr><td>Column 1</td><td>Column 2</td></tr>";$query = mysql_query("SELECT * FROM table");while($getArray = mysql_fetch_array($query)){print "<tr><td>$getArray[number]</td><td>$getArray[name]</td></tr>";}
Note that while{} is an ongoing loop, it will load any number of recordswich will display a full list* of each record, showing number and the name attached to it.
* To limit the number of results change the query by:
$query = mysql_query("SELECT * FROM table LIMIT 10
the above code would limit the number of results (rows) to 10* To order the number of results change the query by:
$query = mysql_query("SELECT * FROM table ORDER BY number DESC");
the above code would order the list by number descending* To do both:
$query = mysql_query("SELECT * FROM table ORDER BY number DESC LIMIT 10");
any questions ill gladly answerAre there any other easy methods to show only 1 record with corresponding no. easily?
-
For example...a table have 2 columns, 100 rowsfor column i.e. no, nameI want to get corresponding name when no=17How to write this php coding??
-
Everyone mentioned it! You used
mysql_query(ALTER TABLE `xxx` ORDER BY `no`) or die ("Error:".mysql_error());
when you're supposed to have the quotes!Try this on line 9.
mysql_query("ALTER TABLE 'xxx' ORDER BY 'no'") or die ("Error:".mysql_error());
P.S. Please understand this! Replace the line, OK?pawitp, by using Post #8 data,
I tested different kind of quotes and I now find that quotes MUST NOT be added around table and colunm.
However, in this topic, many visitors just asked me to change the quote's sign or omit the semi colon.
So I think many people miss this rule.
>> quotes MUST NOT be added around table and colunm.
By the way , thanks for no9t9's help~~
Hope no one make this mistake again ~
----------------------------------------------------------------------
SUMMARY
Only this code can run~
mysql_query('ALTER TABLE xxx ORDER BY no');
All of following codes CANNOT work.mysql_query(ALTER TABLE `xxx` ORDER BY `no`;);
mysql_query(ALTER TABLE `xxx` ORDER BY `no`);
mysql_query('ALTER TABLE `xxx` ORDER BY `no`');
mysql_query('ALTER TABLE \'xxx\' ORDER BY \'no\'');
mysql_query("ALTER TABLE `xxx` ORDER BY `no`");
mysql_query("ALTER TABLE 'xxx' ORDER BY 'no'");
-
Here is my full report.
User name , password, permission,etc ..
all are normal~
1. can run successfully ( this code is for testing only)
<?$ip="localhost";$user="xxx";$pw="xxx";$link=mysql_connect($ip,$user,$pw) or die ("Error:".mysql_error()); mysql_select_db("xxx") or die ("Error:".mysql_error());//mysql_query(ALTER TABLE `xxx` ORDER BY `no`) or die ("Error:".mysql_error());mysql_query("UPDATE xxx SETip='test' ,password='test' where no=41");mysql_close($link);?>
2. can run this code in phpmyadmin's sql query directlyALTER TABLE `xxx` ORDER BY `no`
3. cannot run this code in phpmyadmin's sql query and a error is shownmysql_query(ALTER TABLE `xxx` ORDER BY `no`)
error message
4. After run this file, a error is shown.#1064 - 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 'mysql_query(ALTER TABLE `xxx` ORDER BY `no`)' at line 1
<?$ip="localhost";$user="xxx";$pw="xxx";$link=mysql_connect($ip,$user,$pw) or die ("Error:".mysql_error()); mysql_select_db("xxx") or die ("Error:".mysql_error());mysql_query(ALTER TABLE `xxx` ORDER BY `no`) or die ("Error:".mysql_error());//mysql_query("UPDATE xxx SETip='test' ,password='test' where no=41");mysql_close($link);?>
error message:
line 9 meansParse error: parse error, unexpected T_STRING in /home/xxx/public_html/test.php on line 9
mysql_query(ALTER TABLE `xxx` ORDER BY `no`) or die ("Error:".mysql_error());
* I manage the table into descending order before every testing.* phpmyadmin version: 2.6.4-pl2
* php version: 4.3.10
* PERL version: 5.8.4
please help to solve this strange problem~~
-
It is better if there is a editting power for people to edit their own topics.
-
Of course i have that table and colunm.I had said before
mysql_query(ALTER TABLE `xxx` ORDER BY `no`;);
Why i cant run the above code?!But i can directly type and run this code in phpmyadmin's sql query
ALTER TABLE `xxx` ORDER BY `no`;
Actually, there is only a main code.You asked the above question seem to be kidding me.
Why don't you read my article completely before replying.
Why don't you ask me whether my connection password is correct or not.
Anyway, forgive my non-enough information.
Here is the whole file.
There is no error message with nothing happen.
<?$ip="localhost";$user="xxx";$pw="xxx";$link=mysql_connect($ip,$user,$pw)or die ("Could not connect"); mysql_select_db("xxx");mysql_query(ALTER TABLE `xxx` ORDER BY `no`);mysql_close($link);?>
But i can directly type and run this code in phpmyadmin's sql queryALTER TABLE `xxx` ORDER BY `no`;
So I want to know whether php can use order function.What's going on??!
-
So.....what's wrong with the code??
Please correct it~~
-
well~
mysql_query(ALTER TABLE `xxx` ORDER BY `no`;);
mysql_query(ALTER TABLE `xxx` ORDER BY `no`);
mysql_query('ALTER TABLE `xxx` ORDER BY `no`');
mysql_query('ALTER TABLE \'xxx\' ORDER BY \'no\'');
mysql_query("ALTER TABLE `xxx` ORDER BY `no`");
mysql_query("ALTER TABLE 'xxx' ORDER BY 'no'");
I finished testing.All of above cannot work!!
I want to know whether php can use order function.
-
Well There is nothing that I like In that game anyway..
Bad graphic, adn when fighting you and your enemy are hitting each other evry second like robots. And thats realy bad. Just that you know that I have played runescape with my character to level 16 and the I got pissed of, of the hole game. So I dont want to play it anymore... But much kids are playing it and they think that it is fun.
I think those games is for those who cant afford for paying real multiplayer games but ofcorse is not just for them.
For the web-based game,i think it is not really bad graphic.
Of compraing with install- game, it is really bad
-
mysql_query(ALTER TABLE `xxx` ORDER BY `no`;);
Why i cant run the above code?!But i can directly type and run this code in phpmyadmin's sql query
ALTER TABLE `xxx` ORDER BY `no`;
Notice from jlhaslip:Modified title
-
notepad is really convenience.However, i think it doesn't have any friendly function for editing PHP.
If you just change little things, notepad is the best choice~
Otherwise, you need to use PHP-editor.
Such as dev-php~
-
-
Why don't you give some comments on this game?? Here dont have like to play turn-based game players ??? Most of you love action games or RPG~~ = =||
-
Of course, runescape cannot be compared with other RPG games that nee to install.But i think that runescape is a excellent web- based RPG game, isn't it?
-
forgot password??!@@"lv80, it is excellent~~
I want to have it~~
-
RuneScpae
It's a free online RPG.
You only need to have a web browser to play the game
Offical site: http://www.runescape.com/
There are over 10 thousands players.
Since the game is using Java (applet technology) , the quality is excellent.
It provides 3D environment and wonderful images.
You can also open a gold account that has special features.
Let's try this free game. You no need to install.~~
-
-
Dev-PHP is a free php-editor from sourceforge.
Official site: http://devphp.sourceforge.net/
It is useful programme to edit php files with good GUI platform.
Get it and try to use it!!
Please give some comments on it after you have used it.
-
-
K I wanna get some shooter games but I'm proabably only gonna end up getting 2. Here are the ones I want, but can't decide between:
Counter Strike Source
Battlefield 2 (pc or ps2?)
Star Wars Battlefront (which system?)
Conflict Global Terror
I have (well I'm gonna) have PS2 online and I'm interested in the onlin segments of these games. Any recommendations?
I encourage you to choose Battlefield 2 on PC.Of course, you need to have strong computer to pplay online
Php Writes Into Txt File a question
in Programming
Posted · Report reply
..thx a lot~~successful!