Displaying MySQL Results As URLs
I'm attempting to turn the results of a query into urls, yet I keep getting this error, "Parse error: syntax error, unexpected '<' in staff.php on line 190." I've coded and recoded this, yet for some reason I cannot get this error to go away. I know it's probably simple, but what am I missing? Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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?
PHP Urls With Variable Data In Search Engine Results
I've been given conflicting answers about search engines picking up urls like: http://mysite.com/index.php?var1=1&var2=2&var3=3 Do search engines pick up these urls? I've been considering converting a site of mine to PHP-Nuke, but if the individual modules aren't picked up in search engines I'm not going to do it.
Displaying Limited Results
I have a problem that is related to limiting the results displayed in a page. I have a numbered pagination script working that has a limit etc. At the moment it is milited to displaying 8 results before producing the next link. What I have is a table with 2 columns and 4 rows....a grid of 8. I want the results to start in the top left and then when 2 table cells have been created it will start a new row and do this for all of the results ie: 1 2 3 4 5 6 7 8 Basically, i need code that will make a new row start when 2 results have been displayed in that row.
Help With Function For Displaying Calculation Results
I am developing a betting calculator and at the moment I am working on some functions that can be used to display the HTML for the form to enter your bet and odds and the results. I am still relatively new to PHP and I am learning all the time so sorry if this is a simple problem! I have 3 files: calc1.php, index.php and funtions.php Here is index.php PHP Code:
Displaying Results On Multiple Pages
I have a search query via PHP and MySQL that has list of results, but I only want to show 10 or 15 on a page. Much like Yahoo! or even here on the Devshed forums. I have been working on a system that cycles through all the results with a while loop and a counter. It only displays results >= 11 or <=20 as an example. I am passing that data (the results start point through the url) I am just worried that if the results are in the thousands this system would get very slow.Is there an easier/better way that I am not seeing?
Nesting Queries And Displaying Results.
i am in the process of trying to make a simple system to keep track of switch ports and what points they are conencted to. the problem i am having is with displaying the data from my ports table. Code: mysql> select * from Switch_Ports; +------+----------+---------+------------+--------+ | SwID | Port_NO | VLAN | Patch_Port | PortID | +------+----------+---------+------------+--------+ | 1 | fa1/0/1 | staff | AA10 | 1 | | 1 | fa1/0/2 | staff | AA12 | 2 | | 2 | fa1/0/10 | staff | AA100 | 3 | | 2 | fa4/0/12 | staff | BB12 | 4 | | 3 | fa2/0/11 | student | A16 | 5 | | 3 | fa1/0/23 | student | B14 | 7 | +------+----------+---------+------------+--------+ SwID relates back to my Switch table, which contains dns names and stuff like that. for example i want to be able to display the ports from SwID 1 PHP Code:
Displaying Array Results In Table
I'd like to display the results of an array in a table format with the Alias, Alias Destination & Username as column headings & the results underneath. PHP 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?
Displaying Database And Getting Unwanted Results...
I want to display everyone in the database, but only if the 'level' field is larger than 0. Well, this works fine for most of the database... but if the last entry in the database is 0, then it prints it anyways. Is there anyway around this? I tried adding an if statement before the last bit where I echo out the table rows, but it was killing the entire table, or still showing the same results. Code:
Displaying Results With Decimals, And Stylizing Them.
I just have what I think is an easy question for some of you. I have a page that pulls all the entries from a specific table in the database. The results are displayed in a table. In this table there is column for "job_number" this job number is a decimal entry, i need to display the job numbers, grouped by the the numbers ahead of the decimal place and then ordered by the numbers after the decimal. I would also like to indent the decimals ONLY numbers below the under that does not have a decimal. Code:
Displaying Results From Database In A Particular Format
How do I display results from a database in a particular format. For example the following text in this format including the lines in stored in the database: Quote“Hello, Welcome to the news for 11/06/07. Thanks” When I echo the results using the usual, <? echo $row_news[‘news’]; ?> it doesn’t echo the information in the database in the format it is stored for example it will display like this. Quote“Hello, Welcome to the news for 11/06/07. Thanks” How do I get it to display in the format it in displayed in the database?
Displaying Search Results In Pages
I am implementing search functionality in a website. ( internal search). In that I am taking a keyword as input and searching all the pages and storing results in an array. I want to display 10 results per page. I wrote below logic for that. Code:
Displaying SELECT Results In A Formatted Table
I was wondering how to show a table with a max limit of 20 results per page. I have various data being pulled and its putting it in a table, but its displayed all in one row. I want to format it so its a 4 column/5 row table. With that I then want the page to generate a numbered list at the bottom that calculates how many pages it takes to show 20 items on each. Code:
Displaying SQL Query Results In 3 Column Table
I would like to be able to display the results of an sql query in an html table, but the results need to be displayed in three columns, for example: Column 1 Column 2 Column 3 Result 1 Result 2 Result 3 Result 4 Result 5 Result 6 Result 7 Result 8 Result 9 I've tried to find the answers on the internet but i can't find anything that suits my needs!
Displaying Select Information From XML Search Results
I am new to both php and xml. I have a school assignment to update an existing php-based website where I have to display search results from an online library. I can use a url search which returns an XML file that includes tags such as position, title, url, description, date, etc. I only want to display the title, url (preferably the title should be a link to the url), and description for all of the results on my website's search results (different template as well). What classes/functions are available to help me do this? I would appreciate any guidance as well as links to online tutorials etc. that would point me in the right direction. I have read about the general aspects of php, and I have experience with Java and C; but I don't know about xml at all. By the way, the website is running on the school server and has php version 4. I don't think I'll be able to install php 5 but I can probably upload some helper files or something.
Retrieving,Sorting & Displaying Multiple Results From Mutliple Tables
I need to know how to run a php / mysql query to do the following. I have 1 database (lets call it "database" for now) within this database there are multiple tables ("News","Feature","Header_feature") For NEWS I need only the 6 latest results pulled from that table and displayed in a table. The "News" table has the following columns "ID","Title","Date","Body","Image" For Feature I need only 1 result retrieved from the database and displayed under the variable $ticker as it will display as a scrolling marquee within a table. The "Feature" table has the following columns "ID","Ticker". For Header_feature I need only 1 result retrieved from the database and displayed in the following manner <a href="$link"><img src"$header_feature">[/url] The "Header_feature table has the following columns "ID","image","link" How would I code this all into 1 page? I cant seem to get the query to do everything I want it to and display the results properly. You can see what I have so far at www.getlivemedia.com The $ticker is the scrolling text near the top of the page and the news is obviously the bulk of the page and $feature_image is the broken image.
Mysql, Php And Erratic URLs
i have db with text field contents links <A href="http://www.in.world" target=_blank>In.World</A>, After system upgrading links appears as: http://www.my.server/"http://www.in.world/" in MSIE (Win), and: http://www.my.server/"http://www.in.world" in Mozilla (Lin) Before upgrade all was correct. my system is now: Linux MDK 2.4.18, glibc 2.2.4, MySQL 3.23.52, php 4.2.3, Apache 1.3.26
Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results. I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:
PHP, MySQL And Displaying JPG Images
I got a script that is supposed to display a JPG image from the database, but, instead of displaying the image, it displays the JPG binary output with those alphanumeric characters. Coule this be a Header MIMI type problem in my script?
Displaying A MySQL String Using PHP
I've got a multiline string of data held in a MySQL database. I can extract the data using PHP and display it on the screen but when I do so, the string loses all of its formatting (i.e. The carriage returns and line breaks get lost and the string is placed all on one line). How can I display the string correctly without using a <pre> tag and without putting the string into a <textarea>.
Displaying MySQL Tables
I am creating a database that allows anyone to fill out a form and be added to the MySQL database. My problem is, I can't see who has been added. Could anyone please help me with the PHP code for this? I have tried the following: PHP Code:
Displaying Mysql Querry
I have problem displaying this mysql table from datbase: I need to show column hrt1 from table hrt order by id CREATE TABLE hrt ( id int(11) NOT NULL auto_increment, hrt1 varchar(255) NOT NULL default '', hrt2 varchar(255) NOT NULL default '', hrt3 varchar(255) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM; I tried this but it isn't working: PHP Code:
Displaying An Image From A MYSQL DB
Can someone point me in the right direction as to display an image in PHP that is being stored in MySQL? Basically I know how to store the image in MySQL, but getting it to display on a web page is what I am having trouble with.
Displaying The Top 4 Mysql Database's
I was wondering how I would Display the top 4 mysql database's? I was thinking of using the switch function but I don't know what the variable would be.
Displaying Text From MySQL
I am working on a very simple news page for a website. I've setup a simple form that writes news to my database and the data is then displayed on my news page. I have gotten everything to work successfully but the content in the article loses all its paragraph formatting when I try to display it. I can use break tags to make the formatting show up but there has to be an easier way. This is the code I am using now, which I found on a tutorial somewhere and then tried to modify to work for my site: Code:
Error In Displaying MYSQL
I am having this problem at the moment with this script below. The probelm is that it keeps on chucking out an error: QuoteParse error: parse error, unexpected $end in index.php on line 559 Online 559 is just the close of the html tag outside of the php. Code:
Displaying Mysql On Web Page
i am archiving data in mysql, each has an id number from smallest (oldest) to largest (newest), by the week. on my website, i would like to display only the newest week and the week before it. (or the weeks with the largest ids). how can i do that?
Displaying Full URL Address From Mysql DB
Hi all I am having a problem, displaying a field form my mysql db. the field is a text varchar(80) containing url's (web addresses more importantly). the issue is, when a user enters into the db an address without the 'http' suffix on the start of the url, I try to display it.. but obviously the browser then renders it as a file to the root directory when actually its an entire new url. Did I explain that good enough?
Displaying MySQL Column Names Using PHP
I'd like to be able to display the column names of a table on a page. Is there a way to read that information in using SHOW? And then to display that information again? Or would I have to store these names in a seperate table and display these values? I tried this, but it sure didn't work: $result = mysql_query ("show columns from industries"); print ("<table>"); if ($row = mysql_fetch_array($result)) { do { print ("<tr><td bgcolor=#cccccc>"); print $row["field"]; print ("</td><td bgcolor=#cccc00>"); print $row["type"]; print ("</td><td bgcolor=#cccc00>"); print $row["null"]; print ("</tr>"); } while($row = mysql_fetch_array($result)); } else {print "Sorry, no records were found!";} print ("</table>");
Displaying Text Pulled From A MySQL DB
I have a web edit, delete and update script set up. its all working pretty much as i need except for one thing, the editing function. When an admin clicks edit beside an entry that page is resubmitted using $PHP_SELF and a variable is set. A check is then carried out in each form field to see if this variable is set, if it is set then a query is carried out and it enters the value of the query result for a table field as the value for the form field. You can see this in the code below. My problem is this: when the values of the DB are echoes out into the form fields they dont display correctly or they just display the first word until they reach the first space and then nothing else. PHP Code:
PHP MySQL Query Not Displaying Data
I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the new values are updated in all corresponding tables (the function of the pages in question). However, on the page that does the DB update, I also want to do some checks on the data before performing the update. Now, the problem that I am running into is that when I don't update the primary key field (keyid) the page is running into the section where it displays a message that the keyid already exists. This only happens when the keyid on the previous page is not changed. Upon troubleshooting the problem I found that the very first SELECT statement does not seem to be returning any rows despite the fact that the statement, when run on the SQL server, returns exactly one row. If any could provide some assistance with this matter, I would be most appreciative. Code: <?php session_start(); header("Cache-control: private"); //IE 6 Fix //continue if authenticated if ($_SESSION['auth'] == 1) { //get variables from post $keyid = $_POST['keyid']; $username = $_POST['username']; $corpid = $_POST['corpid']; $usergroupname = $_POST['usergroupname']; $oldkeyid = $_POST['oldkeyid']; $oldcorpid = $_POST['oldcorpid']; echo("Keyid: $keyid"); // Connect to MySQL mysql_connect ("address.com", "user", "pass") or die ('I cannot connect to the database because: ' . mysql_error()); //select database on server mysql_select_db ("seniorproject"); //SQL Statement $sql = "SELECT keyid, corpid FROM users WHERE keyid='".$keyid"'"; // Execute the query and put results in $result $result = mysql_query( $sql ) or die ( 'Unable to execute query.' ); echo mysql_result($result,0); // Count number of matches and print to screen $numrows = mysql_numrows( $result ); if ($numrows == 1) {echo(" SQL Query: $sql"); $result_ar = mysql_fetch_row($result); $result_ar = mysql_fetch_row($result); $dbkeyid = $result_ar['keyid']; $dbcorpid = $result_ar['corpid']; echo("<br> CorpID: $corpid <br>"); echo(" DBCorpid: $dbcorpid <br>"); echo(" DBKeyID: $dbkeyid <br>"); if($dbcorpid == $oldcorpid) { //If this condition is true, then KEYID has not changed. Execute code // Formulate the query $sql = "UPDATE users SET corpid = '".$corpid."', username = '".$username."', usergroup = '".$usergroupname."', keyid = '".$keyid."' WHERE keyid = '".$oldkeyid."'";........
[MySQL] PhpBB Not Displaying Topics
Yes, I know there exists a suport forum for discussion about problems with phpBB, but noone there seems to know the solution to my problem... so I ask here. I've been messing around with phpbb_ tables in my database... I'm trying to convert a incomplete Ikonboard forum to phpBB, and had to do lots of stuff manually (which is fine as I'm familliar with MySQL). And, now I'm stuck and can't figure out the problem... The forum in question is: http://fly.srk.fer.hr/~nick/remorkeri/phpBB2/ The situation is this: a) from the outside: On index.php I can see numer of topics, number of posts and info about last post. On viewforum.php I get "There are no posts in this forum.". b) from the inside: select post_id, topic_id, forum_id from phpbb_posts; returns a whole bunch of everything, so this table seems OK. select post_id, post_text from phpbb_posts_text; same thing. select topic_id, forum_id, topic_title from phpbb_topics; same thing. So, form the inside everything seems nice. So, why viewforum.php doesn't see the articles? I tried to figure out the PHP code, but couldn't, haven't got all the time in the world...
Problem Displaying The # Sign From Mysql
I have a "#" sign in one of the fields of mysql db. I tried using htmlspecialcharacter(), htmlentities() and stripslashes() to have it properly displayed, but none of them work. How does one display the # character in PHP?
Displaying Inline Images Thru MySQL
I run a board that runs the Invision Board program. We are a photography forum, so lots of images get posted. IPB places all uploaded images and the GD-created thumbnails in one directory... right now there are over 40,000 files in there. We would like to archive the older images in a different place, so I devised a script that uses a coped table from the database with all rows without a image post deleted. The problem I have is that the database cross-references the original filenames with the new names they are given on the server. DSC_1000.JPG would get renames to "post-107-12382148343984.jpg" for instance. We would prefer to keep those "post" names for security, but would like to duplicate the method IPB uses to display the images with the file saving as the original (DSC) filename. Dissecting the IPB code returned nothing I can use nor figure out without a complete re-write of my script. So how would one go about opening a file depending on the query string, and place the real name of the file into the header dynamically? I have tried the following, and other derivations, but keep getting errors: PHP Code:
Problem Displaying Pdfs From Mysql
I have uploaded a pdf file into my db and am trying to display it again here is the code i have used (at the moment it is just displaying the binary file's code as text in a html page: <?php session_start(); include("connection.php"); $query = "SELECT resource, resource_name FROM tblresources WHERE id = Ɖ' "; $result = mysql_query($query) or die(mysql_error() ); $row = mysql_fetch_array($result); $content = $row['resource']; header("Content-type: application/pdf"); echo $content; ?> //am i missing something else to go with header to make it be read as a pdf file?
Displaying The Number Of Featured Ads In Mysql
I was looking for away to have it display how many featured items are in a table then display that number in the admin next to the featured item check box that way the person know how many items are currently featured.
Displaying International Characters From Mysql
I have a database with international characters and they display perfectly in phpmyadmin. However they come up as a "?" (question mark) when I try to call them in my pages. I have the encoding set to: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> which is the same as phpmyadmin. What am I doing wrong?
Displaying A Pdf Coming Out Of A Mysql-db In A Frame
I have a mysql-database with some pdf in it. I can send them to a webbrowser using this script: <?php //output.php4 $sql = "SELECT * FROM tbfiles WHERE tbfiles.ID={$id}"; $result = mysql_query($sql); $dateien = mysql_fetch_object($result); $daten = $dateien->Inhalt; $name = $dateien->Dateiname; $groesse = $dateien->Groesse; $typ = $dateien->Typ; header("Content-type: $typ"); header("Content-length: $groesse"); header("Content-Disposition: attachment; filename=$name"); echo $daten; ?> My problem is that I get a download dialog where I want to save the pdf but I want to open it in a fram or iframe like this: <iframe src="./output.php4?id=129" width="100%" height="400" name="outputbox"> where id=129 indicates my document. I get the correct result in Internet Explorer (but not in Opera) if I change the script like this: header("Content-type: image/jpeg"); header("Content-Disposition: inline; filename=$name"); Does anybody know a solution for Opera? Then I could provide different scripts depending on the browser. Or even better a solution working in all browsers?
Problem Displaying Images With Php And Mysql
I am uploading images to a server and saving the script location to a mysql database. It is loading into the server. When I call it with PHP it doesn't show up. When I try to access it directly I get a an error stating that this directory is restricted without an index file. I added an index file, but it made no difference. The directory is set to 777. Also, I manually changed the chmod on the image to 777 and now I am getting a "page not found" error. here is the upload code:
Drop-down Displaying MySQL Data
I've got this dropdown trying to call the data in...basically, I only want it to show if it is an upcoming event. Past events are hidden away in the archives. I can get it to work if I remove the if ($row['date'] etc, but not with it in. Can anyone spot any errors with my code? Code:
Displaying An Array From Rows Retrieved From Mysql
I have a web site where users can add pages to it. When they make a new web page the url of the page and username of the user who created it is stored in Mysql. When the user logs back in the users previously made pages are displayed as links or atleast should be. Below is the code that I am using. PHP Code:
Reading And Displaying A Date From A MySql Database
I've just started using php, and although I am very impressed by it, there are some things with which I am confounded! What I'm trying to do is read in a Date from a mySql database and then display it on screen (the Date is in the usual yyyy-mm-dd format). If I use SQL on phpadmin SELECT Date FROM details WHERE details.Name = "Paul Lee" LIMIT 0 , 30 The result comes up 2005-01-01, so this seems to work. But if I use the following: $db = mysqli_connect("localhost","root",""); @mysqli_select_db($db, "personnel") or die ( "Unable to select database" ); $query = 'SELECT Date FROM details WHERE details.Name = "Paul Lee" LIMIT 0, 30' $result=mysqli_query($db, $query); echo "<br>"; echo $result; mysqli_close($db); I get "Object id #2" displayed on screen. I have tried to use the explode function to separate the months, year and day using the "-" as a delimeter, but this doesn't work, and I can't seem to get the other php date/time functions to work either.
Displaying Select Multiple Box And Using Mysql Join
i have an edit page where the query lists all the information from the database about a business. each business can have multiple types so i made a many-to-many database and now i need to be able to show all the types that are in the db for each business on the edit page. here is what i have so far but it's only selecting the last type of business in the result. PHP Code:
Displaying Line Breaks From MySQL Data
when i retrieve data from a MySQL database which i have put line breaks in they do not show in html, i understand that this is because HTML ignores spaces unless they are formatted as i know i could use the <pre> tag to show it as it was given, which removes all styling from the text, i need to convert the breaks in MySQL into <br> or <br><br> (to start a new paragraph)
Displaying First 50 Characters Of A Mysql Text Field?
I have been searching for hours on the php website for a function that will allow me to display just the first 50 chars of a mysql text field in a results table, but i'm having no luck. I need it to create a results page for a site i'm creating in php.
Displaying Block Of Text From MySQL Database
I would like to create a details.php page that displays all my products. I understand how to get the title, price, description etc from mySQL. But my problem is how do I get a list of data? For example say I want to display the features of a product in point form (list). What is the best way to do this? How do most common websites do this? Code:
MySQL Results Not Working So Hot
Ok. Here I am again....probably posing a question with a solution so easy that, after looking at it for an hour, I can't figure out. Ok. here's the deal. please review the code below. Looks simple enough, right?
If/then Within MySQL Results List
I want to list job opportunities for a facility. If there are jobs in the database, I can list them without a problem. But if there are no jobs, I'd like to echo a line something like: "No jobs right now, come back later." But I can't get that line to echo. PHP Code:
|