mysql

How to remove  character

Hello, I got very strange problem. I have one php website which is running in two server. One is on Apache (Linux) and second is on IIS (WIndow). Linux Server, I just run it for demo. IIS is the actual hosting that I need to host. Even with all the same code, database, in the linux server, there's no  character. But in IIS, everywhere ...

COMPARISON: MS ACCESS & MYSQL

In terms of capacity and performance in manipulating large amounts of data. Which is better, ms access manipulated by vb.net or mysql manipulated by php. ...

help with PHP pagination

hello guys im using this second part of pagination script to show pagination; <? if ($pageno == 1) { echo "<li class='previous-off'>«« İlk Sayfa</li> <li class='previous-off'>« Önceki Sayfa</li> "; } else { echo " <li><a href='{$_SERVER['PHP_SELF']}?isim=$kid&sayfa=1'>«« İlk Sayfa</a></li> "; $prevpage = $pageno-1; echo "<li...

php ADODB call mysql_options() before connection to MySQL

My application is using ADODB to connect simultaneously to 2 MySQL DB. Application is downloading large files; it takes a lot of time so "mysql has gone away" error takes place. I know that MySQL allows to use automatic reconnection which could be enabled using mysql_options(), but I have no clue how to apply this function to ADODB adap...

How to do multiple MySQL INSERTs in a way that scales (PHP)

We have a loop in our PHP code which inserts rows into a table. e.g.: while ($info = mysql_fetch_assoc($someQuery)) { mysql_query("INSERT INTO X (i,j) VALUES ($info['ii'],$info['jj'])"); } This was fine a few months ago because the loop would only iterate several times. However, due to our website getting more traffic this loop no...

MySql takes a long time optimizing a join-less query

We have a simple query that looks like: SELECT a,b,c,d FROM table WHERE a=1 and b IN ('aaa', 'bbb', 'ccc', ...) No joins at all, 5000 contsant values in the IN clause. Now, this query takes 1-20 seconds to run on a very strong (16 core) server. The table has an index on (a,b), and we also tried reversing the index to (b,a). The serve...

Not able to connect to mysql database when firewall in active mode(Using java code)

I connect to mysql database with java coding and give input as hostname,user,password. its able to connect and reterview the data. But when i activated firewall , its not able to connect database. ...

MYSQL - select first 4 records for each category in a table

I have a table INVENTORY that has among other columns CATEGORY and UPDATED. Sorting the table by these columns is easy: SELECT * FROM INVENTORY ORDER BY CATEGORY ASC, UPDATED ASC What I want is to get a result set that contains only the first 4 rows from each category. Any idea how to get it done? ...

Invalid parameter number: number of bound variables does not match number of tokens

I have a table: 'objects' with few columns: object_id:int, object_type:int, object_status:int, object_lati:float, object_long:float My query is : $stmt = $db->query('SELECT o.object_id, o.object_type, o.object_status, o.object_lati, o.object_long FROM objects o WHERE o.object_id = 1'); $res = $stmt->fetch(); Pdo throw error: SQLSTATE[...

How can I represent a single row from result set as multiple rows ?

Given for example a currency rates table with these columns (used 3 here, but in my situation there are about 30): date | eur | usd | gbp 2010-01-28 | X | Y | Z How do I convert it to this one (using row with the latest date): currency | rate eur | X usd | Y gbp | Z I've come up with a query like this: SEL...

Help with MySQL query to select only records with specific value in column

I have following table: +--------+-----------+--------+ | ID | Title | Stat | +--------+-----------+--------+ | 1 | title a | 1 | +--------+-----------+--------+ | 1 | title b | 0 | +--------+-----------+--------+ | 2 | title c | 1 | +--------+-----------+--------+ | 2 | title d | ...

Perform this query when something doesn't exist in another table.

Hello, This is a really tricky question to ask as its very hard to explain what I'm after. Here goes though! SELECT Stock.*, REPLACE (Description, '&', '&amp;') as Description, PRD1.RuleValue AS Price, PRD2.RuleValue AS WasPrice, PRD2.RuleValue-PRD1.RuleValue AS Save FROM Stock INNER JOIN StockCategoryMem...

Accessing MYSQL database using LINQ in asp.net MVC

hi I want to use MYSQL database for accesssing the data in a mvc application. The connection string that i am using in web.config is: Then I have prepared a model,controller,view for accessing and displaying the data. I am using LINQ o get the data from database but getting the exception:" A network-related or instance-specific er...

How do I keep track of the subcategory I am in using PHP?

I have seen it many times, but I'm not sure how it is done. I am referring to sites like online catalogues where they have a legend(or a map) to your subcategory. it looks like: Electronics > Laptops > 15" > Under $500 Can someone tell me what it is called so I can Google it? ...

A 'who has used it' problem

Okay... So, I came across the following problem: I have one table that works properly - it holds users' IDs, posts' IDs, posts' content, time that post was made. I use it to have the following printed out: the content of the post, who is the author of the post and when the post was made. So far everything works just fine. Now... I have...

splitting excel data in to multiple mysql tables

Basically I have a export from an old system with timesheets in it. Each line to simplify it has an employee name, description and time. I have thousands of these in excel rows of timesheets in excel. I want to pop these into two tables Employee and Timesheet Naturally the employee name would repeat many times but I want to have uni...

Multiple and single indexes

I'm kinda ashamed of asking this since I've been working with MySQL for years, but oh well. I have a table with two fields, a and b. I will be running the following queries on it: SELECT * FROM ... WHERE A = 1; SELECT * FROM ... WHERE B = 1; SELECT * FROM ... WHERE A = 1 AND B = 1; From the performance point of view, is at least one...

What do you think about modx to use as CMS?

First of all, hi to everyone! I wan't to ask everypeople if they know modx cms framework, if yes, what do you think about it? If you know it and don't like it, what cms do you advice to use? Thanks in advance, José Moreira ...

Logging mysql queries

Hi guys, I am about to begin developing a logging system for future implementation in a current PHP application to get load and usage statistics from a MYSQL database. The statistic will later on be used to get info about database calls per second, query times etc. Of course, this will only be used when the app is in testing stage, si...

how to get value in array from individual query

i have a Book ID Array Array ( [0] => 61 [1] => 72 [2] => 78 [3] => 100 [4] => 102 ) *now from another table table_bookPrice where price filed is given i want that select all price from table_bookPrice where book id is in given array (book ID Array) and if price is not mentioned in ...