Home » Databases » Page 5
How do I limit amount of items found, AS WELL AS per page?
by NoTine42 in Databases
Syntax: [ Download ] [ Hide ]SXBB[id].writeCmd();Syntax: [ Download ] [ Show ]// how many rows to show per page
$rowsPerPage = 56;
// by default we show first page
$pageNum = 1;
// if $_GET['pagenum'] defined, use it as page number
    $pageNum = $_GET['pagenum'];

[Solved] SQL Syntax when using HTML "Select"
by vyazkov in Databases
I'm using SQL Server 2008 R2
I'm a little stumped on how to properly coordinate a SQL query involving HTML selects as filters for the query. Now, I have no issues using the filters if I want something specific from both. (Querying a rental database and I want a blue boat, easy.) However, the issue comes in when I want all colors available to a specific vehicle. (a green, blue or red

Query: mutually exclusive union
by Netopia in Databases
my table looks like something like:
id | tag_id
1 | 1
2 | 2
3 | 3
1 | 2
I need a query that only grabs the id where it has all of the tag ids in the condition:
select * from table where tag_id = 1 and tag_id = 2
The above query doesn't work. I would expect ID of 1 to be returned.
I'v tried an OR but that includes results that do not have ALL of

MySql Pivot Join Tables Problem
by naemi in Databases
I am having trouble doing a pivoting a table in a join.
Here are my two tables:
id firstname lastname city email
id userid fieldid data
As you can see the info_data table is set up so that is can hold types of data dynamically, it is related to another table which simply holds the fieldid's and their names.
So in info_data there might be e

INNER JOIN - Two Tables, to unique fields. Won't work.
by Henrique in Databases
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]$result = mysql_query ("SELECT catid, id, sceneid, scene FROM products INNER JOIN products ON products.id = products_scenes.prodid WHERE catid = '$c'") or die (mysql_error());
I'm being told:
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]Not unique table/alias: 'products'
What am

not getting accurate age by mysql function
by Erik in Databases
Hello there,
I store Date of Birth(DoB) in a mysql database from a html post form.
So if a user enter 1957-03-07 as his DoB, then it stores as 1957-03-07 00:00:00 in mysql database which field name is 'dob'.
Now I want to calculate age between current date and DoB by a php script.
So I execute following mysql query:
Syntax: [ Download ] [ Hide ]SXBB[id].writeCmd();Synt

Wiki/KB Software that uses SQL Server
by bdurbin in Databases
I apologize if this is in the wrong forum, but after an upgrade to our company's systems, we have all been reassigned to utilize SQL Servers. I have everything up and running on the backend, but I cannot for the life of me, find a replacement for MediaWiki that we were previously using MySQL for.
Is there any Wiki or knowledgebase software, utilizing SQL Server that we can use? Preferably ope

How to check existence of a mysql table?
by James Clarke in Databases
Hi there,
I want to check whether a mysql table exists in a database and run some code based on returned result.
I used the following php code:
Syntax: [ Download ] [ Hide ]SXBB[id].writeCmd();Syntax: [ Download ] [ Show ]mysql_connect("localhost", "[Username]","[Password]") or die(mysql_error());

How to optimise MySQL?
by Matt Watson in Databases
Recently my webhost was complaining that my database programming was placing a lot of strain on the server; I was told to add indexes, so I added a few that seemed relevant and it apparently helped some, but I'm still pretty new to MySQL programming (I taught myself the basics through online tutorials) and I'm not sure what else I might be doing wrong.
All the following were red-flagged, and
TAGS : optimise MySQL

How to return all rows From one table?
by Ali in Databases
Hi there,
I have two tables in my database:
Table1: Purchased Item
Item | Qnt | Rate |Total
Meat | 1 | 20 | 20
Fish | 0.5 | 30 | 15
Chicken|1 | 25 | 25
Meat | 2 | 20 | 40

Can't access a DB2 database
by danielsdesk in Databases
I am trying a DSN-less connection
$DBNAME = 'DRIVER={IBM DB2 ODBC DRIVER};SERVER=sluggo.draper.com:5030;DATABASE=xxxx;';
but I am getting a FALSE value.
Your help will be greatly appreciated.
TAGS : access database

how to show each person with last login date
by Germany in Databases
Hi there,
I have two tables in my database:
Table1: Purchased Item
Item | Qnt | Rate |Total
Meat | 1 | 20 | 20
Fish | 0.5 | 30 | 15
Chicken|1 | 25 | 25
Meat | 2 | 20 | 40

sql server connection ???!!!
by bauer100 in Databases
how can i connect my php code to sql server DB in my network ???!!!

summing column from 3 different tables
by clifton anderson in Databases
Helo Guys,
I'm new member here. I just thought Google is enough to solve my problem regarding mysql.
can someone help me out to solve this.
I have 3 tables.
I have script like this.
Syntax: [ Download ] [ Hide ]SXBB[id].writeCmd();Syntax: [ Download ]

Organize and populate a table :banghead:
by amosk in Databases
Hello gentlemen,
I've recently been given a challenge: create a simple report table to identify all customers and their purchases.
The chosen system (then) was Woocommerce (WP based).
And even though I'm far from being a DB master, I'm pretty sure they really did a crappy job!
They're using 2 tables: wp_posts (where every purchase is created and given an ID) and wp_postmeta (wh

Junction tables - Help simplify
by IHateMyJob2004 in Databases
May I get some help to simplify my database design? I am doing my first project a sports league website with the goal to learn PHP and MySQL.
To keep things simple I am using role based security.
Here are my tables
Users - id, Username, Password, FirstName, LastName, Email
Roles - id, Role
Users_Roles - id, UserId, RoleId
Leagues - id, Name, Alias
LeagueTypes - i

Problem Querying Multiple Rows !! $ !!
by SpunkyJones in Databases
All I'm trying to do is create an array with all the id's that have a value of 0 in the status column of the table.
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]$query = mysql_query("SELECT `tempID` FROM `pending` WHERE `status` = 0");
$status = mysql_fetch_array($query);
This codes has only been returning a single row any ideas?

Problem with postgresql function !
by golazo in Databases
I have a function containing lots of delete statements. It runs without errors, but doesn't seem to do anything, as I can run one of the delete statements by itself afterwards and it will delete rows.
Any advice would be appreciated.
Here's the function (created in pgadmin III)
CREATE OR REPLACE FUNCTION query_delete_unused()
$BODY$delete from category_ow

Is it wise to delete mysql rows frequently?
by John Studdert in Databases
Hi there,
I have user login system in my website. For implementing secure login system and also for browser specific login system, it is need to delete mysql table rows frequently as users logout.
Also a new row will be created frequently while a user logs in to my website.
I can't maintain row for each user permanently because a user can login from 4/5 browsers and for each brows

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .