
Eiolon
Members-
Posts
358 -
Joined
-
Last visited
Everything posted by Eiolon
-
If I used the above in a typical query, it would like like this: $query = " SELECT COUNT(r.report_category), c.category_name FROM reports r JOIN categories c ON (report_category = category_id) WHERE report_added BETWEEN '2009-01-01' AND '2009-12-31' GROUP BY category_name"; $result = mysql_query($query) OR die ('Cannot retrieve a list of reports.'); $row = mysql_fetch_array ($result); Then I would echo $row in a table to display data. That is fine, and I can do that, but I was looking for something similar to how the CLI outputs the data. I was just curious if that was possible or not.
-
Is it possible to output results from a MySQL query using PHP as plain text onto a webpage so there is no need for rows? For example, I run a command in the MySQL commandline and it will output the rows for me. mysql> SELECT COUNT(r.report_category) AS TOTAL, c.category_name AS CATEGORY FROM reports r JOIN categories c ON (report_category = category_id) WHERE report_added BETWEEN '2009-01-01' AND '2009-12-31' GROUP BY category_name +-------+--------------------------------------+ | TOTAL | CATEGORY | +-------+--------------------------------------+ | 16 | BICYCLE THEFT(S) | | 5 | CRIMINAL ACTIVITY | | 9 | DISRESPECT TO STAFF | | 4 | INAPPROPRIATE/FOUL LANGUAGE | | 7 | MEDICAL ASSISTANCE | | 6 | MISUSE OF EQUIPMENT/PROPERTY | | 13 | NOT SPECIFIED | | 7 | PATRON ASSISTANCE | | 19 | POLICY VIOLATION(S) | | 1 | SUSPICIOUS ACTIVITY | | 16 | THEFT OF PROPERTY | | 9 | UNATTENDED CHILD | | 51 | UNRULY / DISRUPTIVE BEHAVIOR | | 6 | VEHICLE ACCIDENT | | 3 | VEHICLE RELATED INCIDENT | | 1 | VIEWING PORNOGRAPHIC MATERIAL(S) | +-------+--------------------------------------+ 16 rows in set (0.00 sec) I was curious if I can have the same affect or do I always need to use rows for displaying it on a webpage?
-
Things that I do: 1. Require a valid e-mail address (send verification links). 2. Require a non-free e-mail address (this can lower your audience the amount of participation so you have to analyze if it's best for you or not). But I feel over the years, banning Yahoo!, Gmail, Hotmail and a few others have increased the quality of my community members. 3. Allow comments to be made by banned IP addresses. You'll want to be able to look for patterns if people start saying they are banned. Lastly, if you do manage to get a legitament IP, find who owns it. I have called many ISP services to have action taken against malicious users. I am not sure if it solved any of my problems, but I never heard from the users again!
-
my servers URL is stuck in front of my links called from MySQL
Eiolon replied to lbcfloors's topic in PHP Coding Help
You can also make it so http:// is already so people only need to put link.com: echo "<td><a href="http://.$db_field['item']."><i>View</i></a>"; If you want to get fancy, you can also check to see if http:// is in the field or not, and if not, have if be added when outputted. -
You forgot to provide us the problem you are experiencing. And no, "It's not working" is not detailed enough.
-
my servers URL is stuck in front of my links called from MySQL
Eiolon replied to lbcfloors's topic in PHP Coding Help
How is the "item" being entered into the database. Is it entered as http://link.com or just as link.com? -
PHP does not know how to count pages in a document. You need to find a parser to do this.
-
Need to limit the character count to 140 in a text area
Eiolon replied to tecate1's topic in PHP Coding Help
You need to put it after the line of code that starts the form submission. So when you are sanatizing all your fields, when you get to that particular field, also include the code Daniel0 posted. -
Website Design Critique - Any Improvements?
Eiolon replied to lostprophetpunk's topic in Website Critique
It looks okay, but then again, it's frighteningly similar to a website run by someone that I know: http://www.artificestudios.com/ -
Thanks again. I have notified my host and I have also filtered PHP_SELF.
-
Thank you. In login.php, I only find PHP_SELF but not the other two variables listed. And for the SSL, would that be something that is controlled by me or by the company that is hosting my server? I am on a shared server at the moment.
-
I am finishing up my admin panel for my site and wanted a security audit. It's very barebones with only user and groups management. Some things I'd like tested: 1. SQL injections 2. Try and bypass the login to get into the admin center. If you manage to get in, please try and do the following: 3. Try and delete the administrator account, or change its values (you should be able to reset the password but that's it). 4. Try and delete the administrators group, or change its values. I will setup a user account that people can login with to test the inside security if no one can break in. Thanks! http://www.intravising.com Profile link: http://www.intravising.com/profile.txt
-
I have a table that holds data. It has 4 columns, 3 do not have any width restrictions but I want the 4th one to have a restriction. How do I tell my stylesheet that this particular column gets a width while the others do not? <table class="data"> <tr> <th>Name</th> <th>Address</th> <th>Phone</th> <th align="center"></th> </tr> <tr> <td></td> <td></td> <td></td> <td align="center"></td> </tr> </table> table.data { width: 100%; border: 1px; border-collapse: collapse; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-bottom: 0px solid #CCCCCC; border-right: 1px solid #CCCCCC; background-color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #000000 } table.data th { background-color: #E5E5E5; padding-top: 5px; padding-left: 5px; padding-right: 5px; padding-bottom: 5px; border-top: 0px solid #CCCCCC; border-left: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC } table.data td { padding-top: 5px; padding-left: 5px; padding-right: 5px; padding-bottom: 5px; border-top: 0px solid #CCCCCC; border-left: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-right: 0px solid #CCCCCC }
-
Thanks very much, that solved it.
-
Can you copy/paste the contents of the document into your post? Thanks.
-
I'm not a designer so I am having trouble understanding the errors. I'm looking for someone to translate for me. I'm trying to validate with XHTML 1.0 Strict. Thanks! and Here is my menu file where the code in question is located: <div id="menu"> <div style="float:left"> <span class="menu"> <ul class="menu"> <li><a href="../index.php" title="Home">Home</a></li> </ul> </span> </div> <div style="float:right"> <span class="menu"> <ul class="menu"> <?php if (isset($_SESSION['id'])) { echo '<li><a href="../logout.php" title="Logout">Logout</a></li>'; } else { echo '<li><a href="../login.php" title="Login">Login</a></li>'; } ?> </ul> </span> </div> <div style="clear:both"></div> </div>
-
You need a table for users and a table for users and their friends. USERS ======= id name etc. USER_FRIENDS ======= uid fid uid is the users id and fid is the friends user id.
-
The SQL itself would be a basic select statement using LIKE. However, what you need to pull it off on the client side is AJAX. I'd search for "Ajax autosuggest" or something similar for some scripts.
-
Your text field should have a value. When you process the form, use that value in your update statement where you have "VALUE FROM TEXTFIELD".
-
http://www.easymodrewrite.com/example-subdomains EDIT: I wasn't clear on if you wanted an actual directory made or if you wanted it to look like one was made. Hopefully the above does what you want it to.
-
Can you clarify what you are trying to do? Aside from the select statement, it looks like you are trying to post data rather than get data.
-
Thanks very much, that is what was wrong.
-
I'd read into database normalization. http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html Looks like you have a many-to-many relationship going on here. A comic can have multiple writers/illustrators and the writers/illustrators could have worked on multiple comics. Also, is there ever going to be a chance when the comics have more than 3 writers or illustrators?
-
You should be sanitizing your data before inserting it. Once you have done that, use something like this: INSERT INTO users (username, password) VALUES ('$u',PASSWORD('$p')); P.S. I recommend using at least MD5 instead of PASSWORD. SHA1 is also popular.