Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Great. For future reference there is a tab in the bottom left marked, "topic solved".
-
Can you list the rules for your match? For something general you could use something like: $file = "120.255.39.1 stringstring.zz.111.222.111.222 [150.100.100.2]"; $regexp = "~(\d{1,3}\.?){4}~"; preg_match_all($reg, $file, $ips); print_r($ips[0]); ?> This may match more then you desire, i.e. numbers over 255, which is why again, we need details. You can take a gander at some examples here - http://www.regular-expressions.info/examples.html.
-
Then do this: SELECT COUNT(*) num, vehicle_year FROM vehicles GROUP BY vehicle_year DESC
-
Change your query to: SELECT COUNT(*) as num, * FROM vehicles GROUP BY vehicle_year DESC And to display the number for each one change your menu output to: ( )
-
Click on the link I provided, there are plenty of examples there are similar to yours. If you can't figure it out, post back with what you tried and why it doesn't work.
-
You can use COUNT() in your query to achieve this.
-
What form? We need a lot more information in order for anyone to assist you.
-
[SOLVED] How to calculate two dates into a percentage
Maq replied to DirtySnipe's topic in PHP Coding Help
You can't do it like that. What kind of precision do you want? Days, hours, minutes? -
you know, most people do live paycheck to paycheck. Not even, the majority of the people in the United States are technically in debt. Granted, it is mostly by choice, such as buying a house or car etc...
-
Where are you getting these exams from where they don't even know the alphabet?
-
Buy Ramon noodles and hunt deer in your backyard.
-
The, "Here's the question, now gimme the answer" threads are frowned upon, not just here but almost any forum. I know it's redundant but like everyone else said, please give your answer and why you think it's right or wrong. Everyone here will help you get the correct answer along with a solid and accurate explanation of why. Therefore, you can apply this concept on other similar questions
-
Great, did you have the wrong database name or something? NOTE - Please click the tab in the bottom left, "topic solved".
-
I wouldn't consider it a waste, but yeah, Google and a search of these forums could have gotten you the answer. Now there's more for others to reference
-
Huh? When you pass vars via HTTP is assumes GET. Try this: if($_GET['cmd'] == 'delete') { echo "Deleted: " . $_GET['id']; } for($i=0; $i{ ?> ?cmd=delete&id='>Record #
-
Sure, you can use pure MySQL to do this: SELECT * FROM table ORDER BY RAND() LIMIT 10 This selects 10 random records from the table.
-
Right here: echo " When someone clicks on the delete link it's passed with the record id to be deleted.
-
Move these two lines right before the if statement: mysql_connect("localhost", "removed", "removed") or die(mysql_error()); mysql_select_db("something_removed") or die(mysql_error());
-
No. For portability reasons you should use relative paths. Your development environment and production environment should maintain the same directory structure, even if it's from windows to linux. i.e. Your folder structure looks like this: You're currently in the 'main' directory and you want to create a folder called 'rimgs' in the includes folder. You would code it like: mkdir("../includes/rimgs");
-
No. '/' will go to the root directory. There are few cases where you need to hard-code a path. If you're in the directory "public_html" you can use: mkdir("rimgs"); and it will create the foldef "rimgs" in the public_html dir.
-
My mistake again. Sorry don't have a testing environment right now. I was using $row rather than $info for retrieving the id. I also added in the delete code at the top of your script. Try this code: if($_GET['cmd'] == 'delete') { $id = mysql_real_escape_string($_GET['id']); $sql = "DELETE FROM news WHERE id = $id"; $result = mysql_query($sql) or die(mysql_error()); if($result) { echo "Row deleted!"; } else { echo "There was an error deleting."; } } mysql_connect("localhost", "removed", "removed") or die(mysql_error()); mysql_select_db("something_removed") or die(mysql_error()); $data = mysql_query("SELECT * FROM stealth") or die(mysql_error()); Print "</pre> <table border="'1'" cellpadding="'3'">"; Print "Url:Link:Clicks:"; while($info = mysql_fetch_array( $data )) { Print ""; Print "".$info['folder_name'] . " "; Print "".$info['url'] . " "; Print "".$info['visits'] . ""; if(!isset($cmd)) { echo "Delete"; } Print ""; } Print "</table>";<br
-
Yeah sorry here: echo "{$row['url']} - Delete"; Forgot a ' after ]}. You may also want to add another table header above the deletes: Print "UrlLinkClicksDelete";
-
Yeah my bad, try this: mysql_connect("localhost", "removed", "removed") or die(mysql_error()); mysql_select_db("something_removed") or die(mysql_error()); $data = mysql_query("SELECT * FROM stealth") or die(mysql_error()); Print "</pre> <table border="'1'" cellpadding="'3'">"; Print "Url:Link:Clicks:"; while($info = mysql_fetch_array( $data )) { Print ""; Print "".$info['folder_name'] . " "; Print "".$info['url'] . " "; Print "".$info['visits'] . ""; if(!isset($cmd)) { echo "{$row['url']} - Delete"; } Print ""; } Print "</table>";<br
-
mackiefan, for future reference surround your code with tags please. Also, if your topic is solved in the lower left hand side of the page there is a tab called "Topic Solved" you can click on.