Below is a code for my pagination. The problem that I am having is that the page count is displayed correctly but when I click on page 2 onwards I just get a blank page.
<?php
if (isset($_POST['edit'])) {
if (empty($_GET['page'])) {
$page=0;
}
else {$page = (int)$_GET['page'...
I have a problem with a sql query. Through the query I am trying to search database for any occurrences of string (can be anything) in a column using the SQL LIKE command. The problem is that it works fine for most of the strings say john, jim, ji"m , but does not work when i include the following characters which are ( ' , { , } , and a...
Hello,
since it is possible to do: INSERT INTO some_table VALUES (NEW.*) in pl/pgsql
can we do something similar but for UPDATE clause using NEW ? I mean i want to
update some row using values from NEW object.
Thanks in advance.
...
I have a n-tier C# ASP .Net application server which uses stored procedures to communicate with the database.
I have a service layer which rolls back all ADO .net transactions if an exception is thrown, using TransactionScope.requiresNew.
In my stored procedure, I want to track login attempt numbers, so we want to keep the transaction...
Question: I'm planning the database for one of my programs at the moment.
I intend to use ASP.NET MVC for the user backend, the database being on Linux and/or on Windows.
Now, even if I would only make it for windows, I had to take into account, that different customers use different database systems. Now, I figured I use nHibernate, t...
I have old .prc files (SQL Server Stored Procedures) which have exported from SQL Server 2000. Now when I try to open a .prc file using SSMS 2008, I get a bunch of chinese characters and other odd characters. I tried a solution found here, but it did not help.
...
I wonder if the SQL geniuses amongst us could lend me a helping hand.
I have a column VersionNo in a table Versions that contains 'version number' values like
VersionNo
---------
1.2.3.1
1.10.3.1
1.4.7.2
etc.
I am looking to sort this, but unfortunately, when I do a standard order by, it is treated as a string, so the order comes ou...
Hi there,
I have a problem when dealing with my QSqlQueryModel. I want to search the database for some items and select them in my QTableView with QItemSelectionModel which needs a QModelIndex.
What I don't understand is how should I search in order to get the corresponding QModelIndex for my model/view architecture.
I can't possibly u...
Please consider this sql statements
Create table abc
(A int,
B int
)
insert into abc values (1,2)
Both of the below statements do the same thing. Why?
update abc
set A = B,
B =0
where A=1
and
update abc
set B =0,
A = B
where A=1
I was thinking that in the later statement B columns value is set first and then A columns' value...
Hi, Is there any solution to generate list of tags (common phrases/words) from sql server full text index. I store some data in xml data type column. I would like to generate common words from that column (performance is on the first place). data changes frequently.
...
table 1
---
id , name
table2
---
id , activity, datefield
table1 'right join' table2 will return more than 1 results from right table (table2) . how to make it return only "1" result from table2 with the highest date
...
how to retrive values from sql 2000 to asp page by stored procedure
...
I have two great tables that I would like to use as foundation for an even greater third table!
The output depends on date interval, like 09/01/2010 - 09/03/2010
Example of Output from TABLE A - - (ALLOCATED Testers)
Date Country Allocated testers
09/01/2010 Nigeria 0
09/02/2010 Nigeria ...
EDIT:
heres my file thats running the query maby its something else acting up - http://pastebin.com/4Cw3xMEM
this works as a direct query in SQLyog
SELECT * FROM wp_posts
WHERE post_status = 'publish'
AND post_type = 'post'
AND YEAR(post_date)=2010
ORDER BY post_date DESC;
it returns the three posts which are from 2010
but when i...
I´m trying to create a VIEW in SQL Server 2005.
The SQL code is working as such (I´m using it in VS2008), but in SQL Server I´m unable to save it, as error message "Declare the scalar variable @StartDate" and "Declare the scalar variable @EndDate" pops up.
Here is the code:
WITH Calendar AS (SELECT CAST(@StartDate AS datetime) AS ...
I'm trying to create a simple stored procedure which I can use to write data to a log table. I'm a noob in stored procedures, so what I'm missing here? I get an error saying:
Msg 201, Level 16, State 4, Procedure toLog, Line 0
Procedure or function 'toLog' expects parameter '@messageTime', which was not supplied.
How to modify this co...
Table1:
Id MyFK f_name l_name
===========================
1 100 John Doe
2 100 Little Timmy
Table2:
Id MyFK item price
===========================
1 100 Car 200
2 100 Bike 100
In MySQL, how do I produce a table like this:
Id MyFK f_name l_name item price
================...
If we need some information that can be achieved only through dynamic query then should not it be written in the application code directly (in DAL) rather than in the stored procedure?
Because the benefit we achieve from SP is already lost if we use dynamic query in it which is the already saved execution execution plan along with it.
...
hi,
i have a function called ViewComments() which retrieve contents from database using SQL commands
private void ViewComments()
{
hookUp = new SqlConnection("Server=XXXX\\SQLEXPRESS;Database=WebExcerciseDB;" + "Integrated Security=True");
SqlCmd = new SqlCommand("SELECT PersonName,PersonMail,Commen...
Let's say I have a table that looks something like this:
-------------------------------
id|column2|column3 |column4
-------------------------------
1 value1 somevalue somevalue
2 value2 somevalue somevalue
3 value2 somevalue somevalue <----- I want this column deleted
4 value3 somevalue somevalue
As you can see I want t...