Here's my code:
<html>
<head>
</head>
<body>
<?php
$user = mysql_real_escape_string($_GET["u"]);
$pass = mysql_real_escape_string($_GET["p"]);
$query = "SELECT * FROM usario WHERE username = '$user' AND password = '$pass'";
mysql_connect(localhost, "root", "");
...
We're setting up RoR with Development on Mac OS X Client (10.6.3) and then using a Mac OS X Server (10.5.8) for testing and eventually deployment.
I'd like to get as many systems in sync on these machines as possible. Wondering if there are any pitfalls. I mostly understand what's necessary under Client but Server has some hard-wired st...
I am working on a new payment module for Magento and have come across an issue that I cannot explain. The following code that runs after the credit card is verified:
$table_prefix = Mage::getConfig()->getTablePrefix();
$tableName = $table_prefix.'authorizecim_magento_id_link';
$resource = Mage::getSingleton('core/resource'...
date_default_timezone_set('America/Guayaquil');
$cnn->execute('SET NAMES utf8');
$cnn->execute('SET GLOBAL time_zone = "-5:00"');
Hi, the code above is run everytime someone enters the website im developing. Does someone know what the impact (in performance) of those commands is?
...
UPDATE files
SET filepath = REPLACE(filepath, `sites/somedomain.com/files/`, `sites/someotherdomain.com/files/`);
I have a table called files with a field called filepath. MySQL returns this error: Unknown column 'sites/somedomain.com/files/' in 'field list'
...
Hi. I'm writing an application to analyse a MySQL database, and I need to execute several DMLs simmultaneously; for example:
// In ResultSet rsA: Select * from A;
rsA.beforeFirst();
while (rsA.next()) {
id = rsA.getInt("id");
// Retrieve data from table B: Select * from B where B.Id=" + id;
// Crunch some numbers using the dat...
Hello,
I want to upload dynamically content from a soccer live score website to my database.
I also want to do this daily, from a single page on that website (the soccer matches for that day).
If you can help me only with the connection and retrieval of data from that webpage, I will manage the rest.
website: http://soccerstand.com/...
I have a table with entries which has a DATE field. Each entry has a distinct date.
I'd like to select all the entries from the last month registred in the database. How?
I tried:
SELECT *
FROM registries
WHERE reg_date = DATE_FORMAT(MAX(reg_date), "%m")`
...without success
...
Hi! I'm trying to create a small search for my site. I've tried using full-text index search, but I could never get it to work. Here is what I've come up with:
if(isset($_GET['search'])) {
$search = str_replace('-', ' ', $_GET['search']);
$result = array();
$titles = mysql_query("SELECT title FROM Entries WHERE title LIKE '%$search%'"...
I want be able to find tags of items under the a certain category. Following is example of my database design:
images
+----------+-----+-------------+-----+
| image_id | ... | category_id | ... |
+----------+-----+-------------+-----+
| 1 | ... | 11 | ... |
+----------+-----+----------...
Is it possible to return groups as an associative array? I'd like to know if a pure SQL solution is possible. Note that I release that I could be making things more complex unnecessarily but this is mainly to give me an idea of the power of SQL.
My problem: I have a list of words in the database that should be sorted alphabetically and ...
Coming for using Sql Server where there are file-groups, i was wondering if there is (i'm sure there is) something similar in MySQL. After all the database cant be limited to just one hard drive( if using windows that is). I've tried to search but its hard to find the something that you don't know the name of!.
...
I have a website that has an update query. Example.
Table name -> myTable
Table Content -> id(AI)
name --> myName
age --> 13
image --> (no values)
birthdate --> (no values)
I only put values in name and age. In image and birthdate, I haven't put anything.
If I ed...
Hello,
I have a unique issue that I need advice on.
I've been writing asp.net apps with SQL Server back ends for the past 10 years. During that time, I have also written some PHP apps, but not many.
I'm going to be porting some of my asp.net apps to PHP and have run into a bit of an issue. In the Asp.net world, it's generally understo...
I have Article table:
id | type | date
-----------------------
1 | A | 2010-01-01
2 | A | 2010-01-01
3 | B | 2010-01-01
Field type can be A, B or C.
I need to run a report that would return how many articles of each type there is per every day, like this:
date | count(type="A") | count(type="B") | count(type="C")
-...
Hi,
I have 2 tables: comments and posts and I'd like to display a list of 15 posts and maximum 2 most recent comments under each blog post
the database scheme looks like this
posts_table: post_id, post_txt, post_timestamp
comments_table: post_id, comment_txt, comment_timestamp
how the mysql query should look like to select 15 posts ...
I have using mysql 5.1 with cpanel /whm centOS.
I had to use trigger for one of my website. so i installed trigger as root so that when something gets inserted on one table there some more rows gets inserted in other table
Everything was working fine, but i have seen that there is no trigger in my dtabase.
How does that be deleted fro...
$sql = "SELECT logs.full_name, logout.status FROM logs, logout WHERE logs.employee_id = logout.employee_id";
tables --> logs
logout
I'm having error on this. I search join tables in google. And that's what I got. What is wrong with this code?
...
So, I've been working on a PHP link shortener (I know, just what the world needs). Basically when the page loads, php determines where it needs to go and sends a 301 Header to redirect the browser, like so...
Header( "HTTP/1.1 301 Moved Permanently" );
header("Location: http://newsite.com";
Now, I'm trying to add some tracking to my r...
I have a database with thousands of companies and their locations. I have implemented n-grams to optimize search. I am making one query to retrieve all the companies that match with the search query and another one to get a list with their locations and the number of companies in each location.
The query I am trying to optimize is the l...