Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




PHP / Microsoft SQL V7/2000 - Page Results


Anyone know a simple way to page results of a SQL Select using Microsoft SQL ? I don't believe they have anything as handy as MySQL LIMIT.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Embed Microsoft Word In A Page Using Php
how to embed or open microsoft word file in a page using php script

SQL Error: [Microsoft][ODBC Microsoft Access Driver] Too Few Parameters
I'm trying to execute the following SQL statement and get the following error.

SELECT DomainNames.DomainName FROM DomainNames WHERE DomainNames.DomainName Like "*ab*" ORDER BY DomainNames.DomainName

SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect

I'm running PHP4, Apache 1.3.12 (Win32) and connecting to an Access database on a Win2K box.

Odbc_exec(): SQL Error: [Microsoft][ODBC Microsoft Access Driver]
i am trying to write to the database through odbc. i get the following error:

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in c:inetpubwwwroot514VIP_SurveyProcess.php on line 41

my directory has read/write permissions why am i getting this? here is the code as an example:
...
$x = 10;
$querySet = "UPDATE Survey SET $rdoOption = $x";
odbc_exec($objConn, $querySet);
...

Having Different Results On Same Page
I have a database that I would like to use to display the contents in different lists on the same page. In other words, I would like a list of the latest 15 entries in the database to appear in list...then I would like the next 15 to appear on the same page but in a different list structure, etc. I have this so far, but it only displays the latest 15...I am stuck on how to get another list generated from the same query: Code:

Use Arrays To Page Through Results?
I've got a search facility that interrogates an SQL database then shows the results 30 at a time. Currently, when you go to the next page of results it has to run the query all over again, because there is no way of handing the resultset to the PHP file. So I wondered if there was another way of doing it.

I'm tempted to use mysql_fetch_array and create a multi-dimensional array full of result rows, then hand that around, but so far cannot find out how to hand a PHP array as a variable to a PHP page.

IS this possible, or am I barking up the wrong tree? Or is there a better way of doing this?

How Do I Make The Results Appear On The Same Page?
Presently i am calling a new file to accept my dropdownlist values. Is it possible to make it such that the results will just appear on the same page? Code:

PING Results On PHP Web Page!
Can someone show me sample code on how can I write a script that shows ping results on a web page.

Multi-page Results....
I'm working on an engine to search a MySQL database of a bunch of forum messages. The PHP code retrieves the results from the database, then stores them into an multi-dimensional array for processing.

Once stored, the code parses each result and assigns it a relevancy score, and once all of the results are scored, it then sorts all of the results according to relevance. The end product off all this is an array that holds all of the retrieved messages relevant to the search, holding such information as title, author, date, msgID, blah blah blah. now that i've kinda explained what's going on, i'll get into the problem i've bumped into.

Being that there's roughly 16,000 messages in the database (not to mention the 800,000 lines of message text) that could possibly be the results from a query, displaying it all on one page is most definately out of the question (it still takes a few seconds to load on my cable line with only a few hops to the T3'd server. I'd hate to see what a 33.6 or 56k user would be waiting for).

The real problem all comes down to: how am I going to pass the results from one page to the next? an array of a few thousand messages is a *little* large for an http post action, and storing the results in a table in the mysql database posses a few problems as well (namely, how long to keep the table around after the user has executed the search. temporary tables are out of the question, as they die as soon as the mysql connection is closed, but a persistent mysql connection would create exactly the opposite problem: ei, temp. tables never die).

10 Results Per Page But From Different Categories
I have a script that shows a list from a different category depending on what is in the URL. I've got it to limit the results to the 1st ten results and keep the chosen category in the link(?category=differentcategory) but when next page is clicked it repeats the same ten results. Code:

SQL Query - Results From Another PHP Page ?
Can I store this PHP code in another page, then refernece it on
multiple pages using Require or Include ???

//results from sql query
for ($i=0; $i<$number; $i++) {
$ID = mysql_result($result,$i,"ID");
$CompanyName = mysql_result($result,$i,"1");
$ContactName = mysql_result($result,$i,"2");
$Phone = mysql_result($result,$i,"3");
$HomePhone = mysql_result($result,$i,"4");
$MobilePhone = mysql_result($result,$i,"5");
$AltPhone = mysql_result($result,$i,"6");
$SecondContact = mysql_result($result,$i,"7");
$SecondPhone = mysql_result($result,$i,"8");
$ThirdContact = mysql_result($result,$i,"9");
$ThirdPhone = mysql_result($result,$i,"10");
$Notes = mysql_result($result,$i,"11")

Getting Other Webpage Results In To Php Page
I Have a page which will take authentication from a diffrent page from
a difrent website.

My program needs to call a page like this from php page lets say:
http://www.abc.com?handshake.jsp?us...htoken=94399843

my php page is at www.xyz.com
based on this url's response i need to print the result on my php page?

I tried this..

$url="http://120.126.79.21:6080/AutoPrintWeb/apvalidator.jsp?tempid=$tempid&authtoken=$authtoken&ipaddress=$rmtadd";
$fp = fopen($url, 'r');
$response1=stream_get_meta_data($fp);
print_r($response1);

The reukt is like this:

Array ( [wrapper_data] => Array ( [0] => HTTP/1.1 200 OK [1] => Server:
Apache-Coyote/1.1 [2] => Set-Cookie:
JSESSIONID=B55CA82D1790D6C0A9E20ED1CEDBB1B9; Path=/AutoPrintWeb [3] =>
Content-Type: text/html;charset=UTF-8 [4] => Content-Length: 382 [5] =>
Date: Fri, 10 Mar 2006 10:22:41 GMT [6] => Connection: close )
[wrapper_type] => http [stream_type] => tcp_socket [mode] => r+
[unread_bytes] => 382 [seekable] => [uri] =>
http://193.186.79.21:6080/AutoPrint...dress=127.0.0.1
[timed_out] => [blocked] => 1 [eof] => )

I need only sucesss or fail..

Return Results On One Page
i have a search field on a .php page. i want to return the results on the same page i.e i dont want the action to point to test2.php but test.php which is were my search filed is sitting at the moment. how do i do this? 

i got this on my first page:

<form method="post" action="test2.php">
Name: <input type="text" size="10" maxlength="40" name="name">

<input type="submit" value="Send">
</form>

and this on the second:

<?php
$name = $_POST['name'];
if ($name=="Friday")
  echo "Have a nice weekend!";
elseif ($name=="Saturday")
  echo "Tomorrow is Sunday!";
else
  echo "Please enter Friday or Saturday";
?>

Limit Results To 20 Per Page.
I have a Database and script where it SELECT * FROM my database and lists the info on my website. I want to be able to limit the quary to only 20 per page. Here is an example of what i am talking about on this page http://sacvalleyhomes.com/Sacvalley/property_inquiry.php

Everything listed under Property Inquiry is genarated be my database. As it is now i have 5 diffrent tables for 5 diffrent pages. This is way to much work to keep updated.

What i want to do is put all 5 tables in to 1 table and have my php script only show the first 20 listing then generate the page numbers on the bottom or some way to view next 20 results and so on. Code:

Why Does My Page Always Show JUST First Set Of Results?
Whenever I execute a query I limit it to lets say 2 rows per page. The problem is my code will only say there is 1 page of results when there should be more! What am I doing wrong? Code:

Results Only X Number Per Page...
am doing a real state site and when searching it shows all the results from the database in one single webpage, can you help me with one easy way to show only 10 results per page?

I've seen some complicated sites with previous and next arrows, i only need to show 10 results then a link to show next 10 and that's it.

Limited Results Per Page
i have a download section for my site, with about 20 downloads, and i was wondering if their was a script so that it would only show 5, and clicking 'next' button would show the next 5 etc.

Search Form And Results Page
I have a table called "lista" into my mysql database.This table has 5 text columns : "TRANSLATEDTITLE" "ORIGINALTITLE" "ACTORS" "DIRECTOR" "YEAR" , and 1 image column called "COVER".

I want to create a page with a form to search entries into this table (ex. with Title, Actors, Director, Year), and anotger php page with the search results shown inside, everyone with a link that opens a pop window (ex. 400X320). Code:

Displaying X Number Of Results Per Page
What I need to do is this. I query a MySQL database and, for example, 400 results are returned. I can get it to display the number of results, but I would like to set a value to display, say 20, results per page and generate numbered links with and offset to browse through and next/previous buttons -not unlike this page. Can anyone point me in the direction of a good article or if you have it, post some code here?

Newbie Question: Results By Page
How do I make results that I select from my database on different pages
based on length?

For instance, say I have over 50 records with more being added and I want it
to display 10 records per page. How do I get that info to display only 10 at
a time instead everything all in one page?

Fetching Results Across Page Loads
I would like to find a way to execute a query against an MS SQL server
and return a small number of rows each page load. However, I cannot
read all the results in during the first page load due to size
contraints.

Here are the details. A user submits a request. I construct a SQL query
and execute on the MS SQL server. The query results in a million rows.
The initial page load shows the first 100 rows. Each successive page
load shows the next 100 rows. Because our web server has limited disk
space, I do not want to return the entire result set now, but only 100
rows at a time. Also, for performance reasons, I do not want to rerun
the query each page load.

So, I need a "persistent result" set that can be fetched from across
page loads. I have tried to store the result set in a session variable
using serialize and unserialize, but to no avail. It seems that across
page loads the result set loses its way, even with a persistent
database connection.

Return Search Results On Same Page
I'm struggling with this much longer than I think I need to,

How do I make the results of a search display on the same page as the
search, sort of beneath the 'submit' button? Thanks for helping out.


Page Navigation From Search Results
I have created a search form that searchs for results from my database matching the criteria to what ever the user inputs. I have done this using 2 php pages the first page points to the second, where the data is sanitised and cleaned accordingly. The results are displayed on the 2nd page. Code:

How Do I Return 10 Results Per Page Using SELECT Statement?
I'm wasn't sure whether to post this under the PHP or under the MySQL section of the forums. Since most people (I'm assuming) who write PHP script, also use MySQL, I thought I'd stick with PHP. I'm rather new to both PHP and MySQL and I'd be very grateful to anyone who can help me solve a problem I'm having at the moment. First, I'll give you an introduction to my little project...

I'm developing a database in MySQL that is used to store the song titles of all the MP3s I have on my PC. I've written a basic search feature that works well. The user has 2 options: Either he can type a special "!ALL" "parameter", that I made up, to return all the songs in the database or the user may enter a few characters in the textbox and select "song title" or "artist" etc. from a dropdown to search for a specific song title or artist etc.. Hope you are following so far? Say for example the user presses submit after typing "!ALL" to return all the song titles - there could be hundreds of results. What I want to do now is display 10 results on a page, then on the next page another 10, etc. (like a real search engine!). I've tried doing it with the LIMIT statement, but like I said I'm new to this and discovered that that is not the right way of going about it. My question is this: how would I go about returning 10 matches per page? Do I use hidden form fields? What would the SELECT statement look like? What would the PHP scripting look like to setup the "back" and "forward" navigation between the result for the search?

Displaying X Number Of MySQL Results Per Page
I'm writing a search on a MySQL DB, and everything so far has just gone swimmingly. I've got a "results per page" drop down box in my form, with a few different values.

At the moment, I'm just using:

while($myrow = mysql_fetch_array($result)

to output results to screen.

I'm not too sure how to go about it, but I did have two thoughts:

1) Suck the results into a multi-dimensional array, and pass the array to a display results script (not sure if you can pass arrays to other scripts???

2) Display x number of results, then have the "Next" (or 2, 3... ) links call the search again, but displaying results x+1 - x+x.

1 sounds like too much trouble, and 2 sounds inefficient. Not too sure how else to go about it. Any info / thoughts you guys have would be much appreciated.

On a side note, how do you look at a specific row in the result?

Limiting Results, And Display Page Numbers
How do I make it so only 50 items display per page. And if there's more than 50, it displays a link "page 2", "page 3" and so on? I know how to limit results with MySQL but how do I generate pages for the next 50 within the PHP code?

Link To Form Results Page Dynamically
I have a dropdown box that pulls information from a database. What I want to achieve is that when a caller selects an option, the option determines that page that comes up.

I tried setting the form action to the name of the option, but this down not bring up anything; actually the resulting page is .php. I also tried moving the form action statement after ther selection, but that does not work either - the Submit button does not work. PHP Code:

Search Results Showing An Include Page
I have a page index.php which includes different templates based on a passed URL variable through the include() function. My problem is that I have the files saved as temp.inc.php files. Search engines are returning the include page as a result and then the user is directed to a new window with just the include page displayed. Any ideas on how to get around this?

How To Pass Mysql Search Results From One Page To Another
I am creating a website that uses PHP to query a MySql database. upon supplying the PHP script with a given search string and search term, a list of scientific documents with attributes such as author, date, url and revision are returned. Each document also has a unique id number within the database. What I would like to do is create a system whereby user of the site can leave reviews for each particular document, much like the product review system employed at jungle.com. I have got to the stage where the php script outputs a list of results each separated by a horizontal rule and what i would like is to be able to place a button on each record marked submit review, which would then take the user to a form where he or she could leave a review which would placed into a reviews table in the database.

However my problem is that i do not understand how to pass the paper id automatically to the form such that the user does not have the inconvenience of having to type into the form. Does anyone have any ideas on how I could solve this problem?

Populating Form From Database, Then Passing Results To Next Page
I have a multiple select input in a form that's being populated by a row
from my database as such:
<input type="checkbox" name="subm[]" value="$row[ID]">

That part is working fine as I can check the displayed page using View
Source and see that the value is the correct row number from the
database. It is then being submitted on a form by $_POST method to
another page where I want to evaluate the checkboxes and display the
contents of the entire row that corresponds to each value="$row[ID]"
that have been checked. But I can't seem to get it to work. I'm having a
problem passing the selected value. Can someone point me in the right
direction?

$query = ("SELECT * FROM `table`");
$result = mysql_query($query);

print "<p>Data for Selections:";
print "<table border=2><tr><th>You chose:";

foreach ($_POST['subm'] as $value) {
print "<tr><td>";
print "$row[ID];
";
print mysql_field_name($result, 1) . ": " . $row[name]."<br>";
print mysql_field_name($result, 2) . ": " . $row[address]."<br>";
print mysql_field_name($result, 3) . ": " . $row[city]."<br>";
print "</td></tr>";
print "</table>
";
}

if (!isset($_POST['subm'])){
print "<p>No matching entry ";
}

mysql_close();

Php Setup On Win 2000 IIS
php setup on win 2000 IIS how is it done, i've try but the pages dont show up . any one know of a step by step setup tutrioal on this please. I have phpMyAdmin 2.3.3 and My SQL.

Window 2000 & PHP.ini Set-up
I know i have to change some of the settings in the php.in file, can anyone tell me how to configure this file. At the moment the PHP works but does not save any session cookies. I only use the machine for web development. Spec :

- Windows 2000
- PHP 4.2.3

PHP On Microsoft-IIS/6.0
Is it possible to make IIS parse .html files the same way as Apache does
with AddType application/x-httpd-php .html in .htaccess?

Windows 2000 Problems
when I open IE and enter in "http://localhost" I get:

"The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings."

blah blah blah....

Then, when I click the Personal Web Manager icon in the Admin tools, I get this error:

"Error connecting to servernamehere: Unexpected error 0x80074002 occurred. Do you wish to continue to attempt to connect to it in the future?"

PHP On IIS Windows 2000 Server
I've downloaded the latest PHP (EXE & ZIP)....

I followed all the instructions I can find and yet PHP will not work with
my IIS !!

Can anyone talk me though exactly how to get them working together?

Upgrading Php On WIN 2000 Advanced
I am currently using php 4.04 on a WIN 2000 advanced server and I want to upgrade. I downloaded the win32 4.3 installer and think its just a matter of running the installer to complete the process.

Is there anything else I need to configure (besides the php.ini) to keep my existing scripts running correctly? I am running multiple sites on one domain so I don't want to screw up the upgrade and cause any downtime.

Installing Php On Windows 2000
I've just installed php on windows 2000 with a pws. How can I test it to see if it's installed correctly.

Installing On Windows 2000 Iis 5
for some odd reason the installer program doesn't set the file extension
..php to be associated with anything, my guess is that it should be
php-win.exe (i've tried all 3 .exe files, and the php.exe produces the
correct results in a command window)... when running a .php in IE I can see
it execute in task manager but the IE screen will not change to display the
correct info.. anyone have any idea about this? IE settings wrong or
something?

Can't Output To Excel 2000
I can't seem to get Excel 2000 to translate an html page. I have Excel 97 perform the same task without a problem, but 2000 just diplays a series of broken image icons.
This the code that I am using to connect to Excel-

Header("Content-Disposition: inline; filename=myfile.xls");
Header("Content-Description: PHP4 Generated Data");
Header("Content-type: application/vnd.ms-excel; name='MIMS_Excel'");
flush;

Is it a coding issue or a setting on Excel that I don't know about, or is it simply impossible.

Number Of Days In 1/1/2000
I am looking for a script that can report the number of days since
2000. It should handle leap years but I am not worried about accuracy
to the hour/minute or seconds. I am writing a calendar program and need
a reference point to base all my dates from. So I picked 1/1/2000.

Compile A Program On Win 2000?
What do I need to compile a program on win 2000? how do i do it? What about with GD Support?

Microsoft SQL Connection
I am looking to have a php page that will have a required include of a
config file with the MS SQL connection creation. I want to have a form
that saves into a MS SQL database. Could call out to a stored
procedure or have inline code in the php page.

Anyone have examples or generic sample code I can use?

PHP With Microsoft Sharepoint ?
I would like to ask if I can synchronize Sharepoint Services with my PHP
website?

Hint: I think it can be done by XML as a bridge.. but I am not sure and
wanna be sure.

PHP And Microsoft Access
Is it possible to use php to interface with an ms access database?

Our current database (customers, suppliers etc) is in ms access format and we need to run msaccess. I dont feel like converting the whole database over to mysql and we still need the original system, the idea will be that the staff can access the database on the road thru a webpage.

PHP And Microsoft Word
I have users who can sent a Word document as an attachment to an email
from a Microsoft-rich environment. I would like to be able to
"capture" that attachment as a blob and deposit it into a mysql
database. I am not sure how to do the capture.

PHP To Microsoft Outlook
Is it possible to send meeting notifications to microsoft outlook through php? I guess it would be sort of an e-mail sent to an individual telling them they have been invited to attend an event and the event info is automatically added to thier outlook calender or something?

Problems With MS-SQL, Apace, PHP On Windows 2000
I want to use PHP for a project at work. This project requires Windows 2000 running Apache and accessing MS-SQL Server 2000. I am using the mssql php extension to access the db and have all the required files to access the db. If the environment was not correct, it shouldn't connect and successfully query int data types.

Everything works fine as long as I query for numeric datatypes such as int. However, every single time I try to query a text, char, var or datetime field, Apache crashes and I get a Windows error dialog saying that an error is being logged. Unfortunately, there is no error logged to either the Windows 2000 Event Log or the Apache log.

I love PHP and would really like to be able to use it for this project rather than JSP or ASP on IIS.

If anyone knows why this is crashing the server, I'd greatly appreciate any advice or help.

By the way, this is an enterprise-wide database so switching to MySQL is not an option.

How Can Windows 2000 Be Shut Down/ Restarted Via PHP?
How can windows 2000 be shut down/ restarted via PHP?

PHP With ADO Stored Procedures In SQL Server 2000
here is the problem..

When this procedure runs I am supposed to get 2 output parameters.
When an insert statement is going to generate duplicate names I get 1
for @checker and 3 for @insertid. When the Insert statement runs
properly I am supposed to get 2 for @checker and an actual identity
for @insertid.

When using the code below, the part where the insert statement is
unsuccessful works just as desired, however the part where it inserts
the record returns zeros for both parameters.

When the stored procedure is run using query analyzer it performs
correctly in both instances.

Here is my PHP code

$cmd = new COM("ADODB.Command", NULL, CP_UTF8);
$cmd->CommandText = "STP_insertartist";
$cmd->CommandType = 4;
$cmd->ActiveConnection = $conn;
$par=$cmd->Parameters;
$par->Append($cmd->CreateParameter("@firstname",200,1,50,$_POST["txtfname"]));
$par->Append($cmd->CreateParameter("@lastname",200,1,50,$_POST["txtlname"]));
$par->Append($cmd->CreateParameter("@livedate1",3,1,9,$begdate));
$par->Append($cmd->CreateParameter("@livedate2",3,1,9,$enddate));
$par->Append($cmd->CreateParameter("@style",200,1,300,$_POST["txtstyle"]));
$par->Append($cmd->CreateParameter("@datedescription",200,1,75,$datetext));
$par->Append($cmd->CreateParameter("@insertid",3,2,4));
$par->Append($cmd->CreateParameter("@checker",3,2,4));
$rec=$cmd->Execute;
$invid=$cmd->Parameters["@insertid"]->Value;
$check=$cmd->Parameters["@checker"]->Value;
echo("Check: ".$check." Invid: ".$invid);.........

EGroupWare - With Windows 2000 Install
using Apache, PHP and MySQL on my own PC - been using
it for a while on ISP hosted servers and plesk to create oline forums using
things like Invision and PHPBB but decided to give running eGroupWare a go
on my own PC.

I have windows 2000 Pro and followed some online tutorial to the letter
(excpet downloaded the very latest version of MySQl, PHP, etc) to install
Apache, PHP and MySQL and all worked fine.

Now downloaded eGroupWare and put it in the c:web folder and ran the setup
file

but when I go to my browser and tpye:
http://localhost/egroupware/login.php

I get the following below can anyone point me in the direction of what it
all means??

Warning: main(C:/php/phpgwapi/setup/setup.inc.php): failed to open stream:
No such file or directory in c:webegroupwareheader.inc.php on line 102

Warning: main(): Failed opening 'C:/php/phpgwapi/setup/setup.inc.php' for
inclusion (include_path='.;c:php4pear') in
c:webegroupwareheader.inc.php on line 102

Warning: main(C:/php/phpgwapi/inc/functions.inc.php): failed to open stream:
No such file or directory in c:webegroupwareheader.inc.php on line 110

Warning: main(): Failed opening 'C:/php/phpgwapi/inc/functions.inc.php' for
inclusion (include_path='.;c:php4pear') in
c:webegroupwareheader.inc.php on line 110

Warning: main(C:/php/phpgwapi/inc/xml_functions.inc.php): failed to open
stream: No such file or directory in c:webegroupwareheader.inc.php on
line 111

Warning: main(): Failed opening 'C:/php/phpgwapi/inc/xml_functions.inc.php'
for inclusion (include_path='.;c:php4pear') in
c:webegroupwareheader.inc.php on line 111

Warning: main(C:/php/phpgwapi/inc/soap_functions.inc.php): failed to open
stream: No such file or directory in c:webegroupwareheader.inc.php on
line 112

Warning: main(): Failed opening 'C:/php/phpgwapi/inc/soap_functions.inc.php'
for inclusion (include_path='.;c:php4pear') in
c:webegroupwareheader.inc.php on line 112

Fatal error: Call to undefined function: createobject() in
c:webegroupwarelogin.php on line 26


Copyright © 2005-08 www.BigResource.com, All rights reserved