Jump to content
xisto Community

kakingho

Members
  • Content Count

    53
  • Joined

  • Last visited

Posts posted by kakingho


  1. 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?? :lol:

    <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


  2. 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 records

     

    wich 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 answer

    215958[/snapback]

    Your method is good to deal with large data.

    Are there any other easy methods to show only 1 record with corresponding no. easily?


  3. 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?

    211490[/snapback]


    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~~ :P:P

    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'");


  4. Here is my full report. :P

     

    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 directly
    ALTER TABLE `xxx` ORDER BY `no`

    3. cannot run this code in phpmyadmin's sql query and a error is shown

    mysql_query(ALTER TABLE `xxx` ORDER BY `no`)
    error message

    #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

    4. After run this file, a error is shown.

    <?$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:

    Parse error: parse error, unexpected T_STRING in /home/xxx/public_html/test.php on line 9

    line 9 means

    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~~ :P


  5. You need to provide more information.  How can we tell what is wrong from a single line of code?  What is the error message you are getting??  Do you even have a table called xxx and in that table is there a column called no?

    210215[/snapback]


    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. :P

    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 query

    ALTER TABLE `xxx` ORDER BY `no`;

    So I want to know whether php can use order function.

    What's going on??! :)


  6. 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. :)


  7. 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.  :P  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.  :D

    208177[/snapback]


    For the web-based game,

    i think it is not really bad graphic.

    Of compraing with install- game, it is really bad :P


  8. What ever happened to good ol' right click  >  open with    >    notepad?!??!!!!!!!!!!!!!!!!??? Its much esiar, and doesn't require any fancy programs or you BUYING any fancy programs at all. Do it, its the best :lol:

    204968[/snapback]


    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~ :)


  9. I used to play runescape. But when i got to lvl 80, had all the quests done, and quite a few characters, I found that it got quite boring. There was simply nothing to do any more, so i quit. Now i dont even remember my password :)

    203898[/snapback]


    forgot password??!@@"

    lv80, it is excellent~~

    I want to have it~~ :)


  10. Posted Image

     

    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.~~ :)

     

    Posted Image

    Posted Image

    Posted Image


  11. I don't like very much this editor. I use RapidPHP for editing my php files and it's very fast and easy to use.

     

    I recommend it to everyone.

    201690[/snapback]


    Yup~!!~

    RapidPHP is another excellent software. :)

    However RapidPHP need to purchase :P while DevPHP is freeware~

    That's why i am using DevPHP~~ :)


  12. Took me ages to compress a file with maximum compression. But the result worth it. 7z also open other type of files other than it's own 7z archieve. eg. rar, zip, etc.

    201512[/snapback]


    It sounds good. :P

    Let me try to install it ~~

    (I am using WinRaR)


  13. 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?

    198615[/snapback]


    I encourage you to choose Battlefield 2 on PC.

    Of course, you need to have strong computer to pplay online :P

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.