Jump to content

FForce2195

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by FForce2195

  1. >what does free site transfer means in web hosting? Where did you exactly read it? If a web hosting company says it, that means they will transfer files from an existing host to theirs for you with free of charge. Moving from one hosting company to another can be very stressful. Mishandling a database can cost you big. We've used 4 different ones. So I know... >is that automatic? No way...
  2. <form action="filename.php" method="post"> <?php $right = $_POST["right"]; ?>
  3. You need to grab a book that explains PHP and MySQL basics.
  4. Hello. It's a silly idea from a 4-week-old PHP beginner. What if you use Javascript with setTimeout("location.href='URL to the PHP file'", 6000000) to repeat the script?
  5. Change <form action=\"drop_pilot.php\" method=\"post\"> into <form action="drop_pilot.php" method="post"> . And you may want to remove all backslashes.
  6. No. I was doing that before. There were so many people using dynamic IP. So I was forced to abandon the IP limit. You can bind each license to a registered e-mail address.
  7. Okay. The following works good. $insert_percent = "UPDATE $table02 SET percent = num/$num_rows*100 WHERE num >= 0";
  8. WHILE ($row_ip = mysql_fetch_array($result_02)) { $$insert_percent = "UPDATE $table02 SET percent = '".$row_ip['num']."'/$num_rows*100 WHERE num >= 0" $insert_result = mysql_query($insert_percent,$my_sql_connect) or die(mysql_error()); } fills the percentage field with the same number. Why? ??? I think this mistake takes me back to the first post where I said that '".$row_ip['num']."' cannot be divided or multiplied by anything.
  9. $ip = <get the ip addres here>; No. I' want to fill any row with (".$row_ip['num']."/$num_rows*100). That's why I'm using WHILE ($row_ip = mysql_fetch_array($result_02)) { } Anyway, I'm very confused about when to use INSERT or UPDATE.
  10. Umm... When I used UPDATE, the same number filled the entire field under 'percent.' And somebody told me that that's what should happen with UPDATE. I'll try again with UPDATE, then. Thanks.
  11. Hello. I'm still a beginner in writing PHP programs. (3 weeks or so...) I hate to ask such basic questions. But I have run out of choices after spending several hours by trial and error. (1) I have a table ($table02) with 4 fields. One of the fields (num) in this table shows the numbers of the times in which the same IP addresses are recorded in another table ($table01). (Please see the attachment if necessary.) If I wanted to insert the same numbers shown in 'num' also into 'percent', I could write $sql_01 = "SELECT * FROM $table01"; $result_01 = mysql_query($sql_01,$my_sql_connect) or die(mysql_error()); $num_rows = mysql_num_rows($result_01); $sql_02 = "SELECT * FROM $table02"; $result_02 = mysql_query($sql_02,$my_sql_connect) or die(mysql_error()); WHILE ($row_ip = mysql_fetch_array($result_02)) { $insert_percent = "INSERT INTO $table02 (percent) VALUES ('".$row_ip['num']."')"; $insert_result = mysql_query($insert_percent,$my_sql_connect) or die(mysql_error()); } But I actually want to insert a percentage in each cell under 'percent' where a percentage is calculated by $row_ip['num']/$num_rows*100. If I write $insert_percent = "INSERT INTO $table02 (percent) VALUES ('".$row_ip['num']."/$num_rows*100')"; or even if I write $insert_percent = "INSERT INTO $table02 (percent) VALUES ('".$row_ip['num']."/30')"; the numbers in 'num' will be duplicated under 'percent.' What am I doing wrong? (2) I only want to insert numbers under 'percent.' If I use INSERT new rows will be inserted on top of existing ones. But I suppose I cannot use UPDATE in this situation. What can I do so that I can enter numbers only under 'percentage' without creating new rows. I'm sorry to ask such a basic question. I search for 'insert rows mysql' and read a few dozen matches. But I didn't find anything particular. Thank you for your time. [attachment deleted by admin]
  12. Hello. I have accomplished several goals thanks to nice people here though I've been writing PHP scripts for just 2 weeks and a few days. I have a small project to work with for the next few days. Then I'm thinking about learning how to extract Google's Gmail messages and importing them onto MySQL. Actually, I don't know if that's possible with PHP. I suppose it is. I have seen a website where they sell a library or something for extracting Gmail messages. I think I ended up with that website after asking a guy named Google or something. I also searched this place with 'Gmail extract' and didn't get precise hits. If you know where I can go to get information on accessing a Gmail account and extracting messages, please let me know. If you can give me a brief overview of what to do, that will be great, too. Thanks a lot.
  13. Yes, that works. Muchas gracias. Muchas gracias to Bendude14 as well. Some day, I'm going to be an expert PHP programmer who will be able to help both of you. Maybe, one year from now...
  14. Hello. I started learning how to write PHP programs about 2 weeks ago. I have a database table that consists of 16 fields. I only want to display selection results under 3 fields for now. And I'm using Smarty to display a table with alternating colors of rows. Everything looks okay except... As you see the screenshot below, each row is encircled by its own table. I want to put all rows in one table. For that end, how should I modify the code below? <html> <head> <meta http-eqiv="Content-Type" content="text/html; charset=UTF-8"> <title>XXX</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="620" width="100%" border="1" cellspacing="0" cellpadding="0"class="title"> <tr bgcolor="#000066"><th width="50">Spam Post ID</th><th width="50">Date (GMT)</th><th width="520">Spam comments</th></tr> {foreach item=spam from=$spam} <table width="620" width="100%" border="1" cellspacing="0" cellpadding="0" class="font_control"> <tr bgcolor="{cycle values="#E9E9E9,#9BB4EE"}"> <td width="50" align="center">{$spam.comment_ID}</td> <td width="50">{$spam.comment_date_gmt}</td> <td width="520">{$spam.comment_content|chunk_split:95:"\n"}</td> </tr> </table> {/foreach} </body> </html> Thanks a lot for your help. Tom [attachment deleted by admin]
  15. Hello. It looks like the table names stated in those codes were wrong. The correct one is $table0a. Now, everything is under control. Thank you very much for your help again, DarkWater, also Daniel0.
  16. I beg your pardon? I test-run PHP scripts on my computer and access a remote server.
  17. Actually, wordwrap works fine. You are a savior. Thanks a lot again. What a great place for PHP newbies...
  18. Whoa... You are quick. You must have years of experience in PHP. Actually, wordwrap probably won't do it because I'm dealing with wrong URLs. I'll test it, anyway. Thank you very much.
  19. Yes. I'll test and see whichever works better.
  20. Hello. I've been studying PHP for about 9 days. I have a table that I imported from another database. There are 16 fields. I only want to display 2 to 4 of them on the screen. A slight problem that I just noticed is that one of the fields contains long, continuous URLs. This field is 'comment_content.' So I wrote $sql_date = "select comment_author, comment_date_gmt, comment_content from $table0a ORDER by comment_ID DESC LIMIT 0,500"; $xdate_julia = mysql_query($sql_date, $my_julia) or die(mysql_error()); print "<html>"; print "<body>"; print "<table border=1>"; print "<tr><td>comment_author</td><td>comment_author_url</td><td>comment_date</td><td>comment_content</td></tr>"; while ($date_row = mysql_fetch_array ($xdate_julia)) { print "<tr><td>" . $date_row["comment_author"] . "</td>"; print "<td>" . $date_row["comment_author_url"] . "</td>"; print "<td>" . $date_row["comment_date_gmt"] . "</td>"; print "<td>" . chunk_split($date_row["comment_content"],50) . "</td></tr>"; } print "</table>"; print "</body>"; print "</html>"; The result turns out okay. But I actually want to use <strong>Smarty</strong> to format the table with alternating colored rows and controlled column widths. So I wrote $xdate_julia = mysql_query("select comment_author, comment_date_gmt, comment_content from $table0a ORDER by comment_ID DESC LIMIT 0,500"); $spam_2k = array(); while ($row = mysql_fetch_assoc($xdate_julia)) { $spam_2k[] = $row; } //Smarty require_once("smarty_2619/libs/Smarty.class.php"); $smarty = new Smarty(); $smarty->assign("spam", $spam_2k); $smarty->display("spam_2k.tpl"); The result turns out okay with beautifully alternating colored rows. But I don't know when to use chunk_split in the second code. Anybody has any idea how I edit my code to split data in the comment_content field? By the way, there are a few thousand rows of data. Muchas gracias, Tom
  21. Yes. I'm sorry. You are right. $sql_date = "SELECT * FROM $tabl0a WHERE comment_date_gmt > DATE_SUB(NOW(), INTERVAL 14 DAY)"; SELECT * FROM table WHERE comment_date_gmt > NOW() - INTERVAL 2 WEEK; Hmm... I don't know why, but whichever I use, 2 weeks of data will be drawn after I change the interval to 1 week, 4 days or 2 days. Actually, I have only 2 weeks of day. So I don't know if it draw the entire data set.
  22. Ahh... That's smart. I'm sorry. I didn't get it since I'm a novice. Here it comes. The MySQL version is 5.0.51a-community in case you needed it. Thanks a lot. By the way, whoever is the administrator, I wish he made an effort in only allowing him/her to see IP addresses. It's easy to make modifications. I know how to do it and can help them if needed since I also have an SMF website.
×
×
  • Create New...

Important Information

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.