2
votes
3answers
239 views

Check if URL contains different strings

The code it self is pretty self explanatory, however i do not think it is very efficient at all. Is there a better way to do this? Its basically so i can track spam sites and save the sites into my ...
7
votes
3answers
165 views

MySQL update with PHP; MySQLi prepared statement in loop

I'm going to develop an Android application that performs simple MySQL operations by invoking server-sided PHP scripts. PHP-MySQL communication is done by MySQLi extension. Each operation that I'd ...
4
votes
4answers
497 views

Two while for the same query

If I have to loop results of a query echoing first all fields of a column, then echoing something not to loop, then fields of another column. ...
3
votes
2answers
147 views

Dynamically load data into bootstrap accordion navigation bar

I have made a bootstrap accordion navigation bar that loads data dynamically from a database with PHP. Here are the two tables that I use: ...
6
votes
2answers
82 views

Modifying `sakila` database

This is not "real life" code. I'm trying to expand upon the well known Sakila sample database for MySQL to make it more complex. Step 7 (or 6) is running ...
2
votes
2answers
63 views

Abusive use of long database query?

I somehow acquired the idea that I should reduce the number of trips to the database as much as possible and so I use a lot of very long queries. For example, I had a function that does this: ...
3
votes
3answers
85 views

Inline PHP IP access log

For a website, I've got some inline PHP, posted below. It's supposed to log traffic to the website, and it does its job fine. But at the end of the day, I'm not even close to a PHP developer, and ...
3
votes
2answers
90 views

Is there a “prettier” way of forming this query, or a more efficient way of joining the tables?

Yesterday I posted a question involving multiple nested queries. The queries pulled information from the database and created a directory listing of all employees. There are two many-to-many ...
0
votes
1answer
62 views

Would multiple joins boost performance, or are the nested queries an acceptable way to handle the situation?

I'm working on a directory that lists employee information. Each employee can belong to multiple departments and each employee can have multiple job titles. I have 5 ...
1
vote
1answer
41 views

How could I simplify this query?

How can this function be better? I feel there might be a more elegant way of doing it. For a little background on the function. I am trying to evaluate if someone has read and seen all the questions ...
2
votes
1answer
150 views

Could really use some feedback on this registration code in php

I was hoping someone could give me some feedback on my code. I am still new to php and I'm sure I have messed up somewhere. The code pasted is for a registration page where users will submit their ...
1
vote
2answers
166 views

Prepared Statements Function

Hello, CR :) I've finally finished my universal query preparation function. Sorry about my previous post, I wasn't aware of the rules before. Anyway, here is a working function. Any suggestions to ...
2
votes
2answers
1k views

PHP-Mysqli example secure?

I'm just writing my first PHP-Mysqli sample (think about a Wiki 0.0.1) and I would like to ask you if this example is secure or not or if there are any other problems/suggestions you might recommend? ...
4
votes
2answers
241 views

Am I on the right track? PHP/MySQL

I have the following table called info: info_name | info_value name | Susan desc | Human I'm trying to print Susan without knowing that ...
11
votes
2answers
478 views

A take on DB Abstraction - PHP / MySql

It's a little bit more code but i wanted to show the full class. I highlight the points i'd like input after the source. I've cut comments since they where not in english and translated the important ...