Displaying List W/out Repeats
I'm working on a project that will allow people to upload content and make entries to a database. I want to build a menu that will display the different values for a certain field, but I know that there will be identical values throughout the table. Do I need to dump values into a separate table, or can I use the values that are there and somehow ignore the repeats?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Displaying A List Of Members Logged In
I wish to display all of the current members who are logged into the system. I figure I can do this using their session id's and matching their usernames accordingly. Or I could create a separate table containing their username and INSERT when someone logs in and DELETE when someone logs out. Then i could display the contents of the table.
Displaying Table Field List
I got a function that displays a list of the fields in a certain mysql table. I got it off of this site. The problem is that it only displays the word Array and I'm not sure why. This is the code for the function: Code:
Displaying A List Of Categories From A Database In A Select Box
Could someone please tell me why this outputs nothing <select name=categories> <? $cat_array = get_categories(); foreach($cat_array as $this_cat) { echo "<option value=""; echo $this_cat["category_id"]; echo """; echo ">"; echo $this_cat["category_name"]; echo " "; } ?> </select> ========================================================== function get_categories() { //get the list of categories from the database $conn = mysql_pconnect("localhost", "user", "pwd"); $query = "select * from categories"; $result = mysql_query($query); if(!$result) return false; $num_cats = mysql_num_rows($result); if($num_cats == 0) return false; $result = db_result_to_array($result); return $result; } //A function that returns a query to the database as an array function db_result_to_array($result) { $res_array = array(); for($count=0; $row=@mysql_fetch_array($result); $count++) $res_array[$count] = $row; return $res_array; }
Displaying A List Of All Modules (extensions) Installed
I just signed up for a web hosting service. They have PHP, but can't tell me which modules (extensions) are installed. Is there a function, or some other easy way, to show all modules (extensions) that are installed? phpinfo() doesn't do this.
Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that: - reads in all the files in a particular directory - displays the file names in a html list and makes a link of them: <ul> <li><a href="filelocation1">filename 1</li> <li><a href="filelocation2">filename 1</li> <li><a href="filelocation3">filename 1</li> </ul> etc.? So basically it creates a list of links with the contents in that directory, so you can download them from there.
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not. What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings. SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = Ƈ') ORDER BY msgno DESC LIMIT 100 What I'm getting, though is a list that looks like this: mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary. If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1. mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 2214 msgno: 0412141622 msglist: 1 mbxno: 2189 msgno: 0412141408 msglist: 1 mbxno: 0000 msgno: 0412141213 msglist: 1 mbxno: 0003 msgno: 0412141213 msglist: 1 mbxno: 2265 msgno: 0412132029 msglist: 1 mbxno: 0000 msgno: 0412131950 msglist: 1 How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let users to reach out to all recipient on the list by simple send the email to a specific maillist- address. Mailman has this functionn but as a just got a webserver account I can't use mailman nor install it.
Displaying A Value Once
How can i get the php page below to display the <? echo "{$row['first_name']}"?> and <? echo "{$row['surname']}"?> just once, at the moment it displays twice (the same number as the <? echo "{$row['art_pic']}"?> results) Code:
Displaying A PDF From PHP
Problem: I have PDF's sitting on somewhere (not on the client), and, using a database command, a selection list of what PDF's they have stashed is displayed. When the person selects the PDF they want displayed, I want to do *something* in PHP which allows me to display the PDF on their screen. Problem is: have absolutely no idea if this is even possible, or if it is, how to go about it.
Displaying X Every Y From A Db Array
ok this is probly the easiest question and i knew how to do it before but cant find it again. ok how do you display x every n from a load of records like from a db. so for example, display <tr> every 6 records from a db? cause i want to display a load of pictures, and i am gonna show 6 then make another row of 6, etc. so i need to add <tr> and </tr> to start and stop the rows.
Displaying Time
I've got a question for yers. I've got this newsfeed and the way the time is formatted is like this: 11:18:13 Question, I've setup a time field in the DB and assigned it timestamp type field, so when I insert the time into DB it enters this as 000000000000. How do I get it to insert the time in this format 11:18:13?? Is there a such way? Perhaps I then need to use the time function to output back, yeah??
Displaying Text
I am just screwing around a little and trying to display some text to the screen via a link to the text in a mysql db.
Displaying A Hyperlink
I pull a string out of MySQL and display it in an html page using PHP. It automatically becomes a hyperlink but if it is a link to a document (www.web.com/test.doc) it won't translate it into a hyperlink. Does anybody know how I might do this?
Opening And Displaying URL
I want to be able to use special javascript commands on webpages on other domains but much of the commands are made to only work on the domain that they come from so to do this, I wanted to make a PHP script that would download the chosen html document and display it so that it would be on my domain. As usual, I've totally screwed things up. I'm so clueless. PHP Code:
Displaying Date
i'm working on K Yank's book and, at some point, i've an insert like this: $sql = "INSERT INTO Jokes SET ... JokeDate = CURDATE()"; When i dysplay this on my webpage, the date format is YYYY,MM,DD and in my country (Portugal), the format is day, month, year How can i achieve it?
Displaying Username
I am newbie to php. I did a login Script using dreamweaver tools.Everything works fine but i have problem showing username like welcome username! on top of page when user logged in.I need like this when unauthorised user enters in to my website it should display login box.When user registered and logged in it should display message like WELCOME user! in the same place.
Displaying Characters
I have a form which accepts text entries. As part of these entries, people can enter anything they like. I can then store these to the mySQL database no problem. The issue comes in when I go to display the entries. Lets say for instance someone enters "<HELLO>" as the text in a field. When I go to display this data later on, it causes problems because of the "<" character (thinking it's html). Question: How can I display the data that I have stored without having this problem occur, and without changing the data which is stored (i.e. I want to preserve the original input, just want to display it correctly and without causing html problems.
PHP Displaying Codes
I installed PHP manually on windows XP (just trying to do things manually) with Apache 2 and Mysql 5. Everything seems working fine. Now i saw very strange problem here, When i write any php code i use <?php ?> and if i dont put PHP after <? then my php code doesnt work.. it displayed code as it is in browser. Even previously i was able to run php without writing PHP after "<?".. can anyone tel me where i am wrong?
Displaying Attachments
I have a shell script which parses an incoming email and stores the full email (including attachments) into the mysql table using an insert statement. This email is then displayed (including attachments) in a html textarea. The attachments are displayed as some junk characters. Is there a way to save this attachment to the hard disk and view it in its original form. I want to do all this through an html form. I guess first I will have to get the required part of text (attachment) from the textarea. Then convert/encode the attachment. Then open a download box.
PHP Displaying Html
I have gotten quite a few small scripts to work so far but now that I'm trying bigger and bigger things I keep hitting a snag that I can't seem to find the answer to. I will either use include() or simply write in the html code for the script to display, but all i get when the script runs is a blank white page. When i view the source of that page all it is is an html tag, head tags, and body tags with nothing between the opener and closer. I've tried everything i can think of to fix the problem and sometimes it pops up and sometimes it doesn't and I can't see the difference in my code that is making this happen.
Displaying And Writing
How would I be able to take the contents of a form, and write it to a text file, and then, be able to, each time someone submits a form it rewrites over the same text file?
Displaying Photos In PHP
We are building an internet based application that would allow any one to purchase online (php generated) reports that include a few photographs. What is the best way to serve the images so that the user wouldn't get hold of other images on the webserver?
Displaying Errors
php_info(); for display_errors variable says: Off, Off. I tried the error_reporting(E_ALL);, but nothing happens. If I have an error somewhere, PHP just silently dies, no output whatsoever. Which variable has to be set so that error_reporting() function works, but no errors/warnings are displayed if the error_reporting() wasn't executed (admins don't want to have display_errors On globally)? PHP Version is 4.3.3. --
Image Displaying
It looks as if you are creating the second image, but not saving it anywhere. This generates an image: imagejpeg($image_p, null, 100)." "; But what about $image? You do a copyresampled then destroy it. If you want to save the image, pass the second argument to imagejpeg.
Partial Displaying Of A Row
How can I display half of a text selected from a row of a database on a webpage. $query = "SELECT content FROM container"; $row = mysql_fetch_row(mysql_query($query)); and I want to display half of the content meaning half of $row[0]...
Displaying Code
I'm trying to build a help file for my web application that includes displaying some of the actual code in the app. Whenever I submit code to the database with form I'm using it behaves like its part of the application. If the code is wrapped in <??> it doesn't even display on the web page. I tried using <? but when I update the record, it converts to <? and the code disappears again. Is there some code I can wrap everything in to display my script properly?
Displaying Text In PHP
I am trying to display a field in a database which is of type text in this fashion: Code: echo $row['thearticle']; However, the character ' is shown as ' i.e: "Britain's" will be displayed as Britain's . Do you what I need to do to solve this?
News Displaying By Day
I was wondering if anyone had some code or could tell me where i could find some reference code for making news display by day... let me give u a better idea of what i mean: Saturday, 0ctober 19, 2002 <news for that day here> Saturday, 0ctober 18, 2002 <news for that day here> If you could paste some code, or at least tell me what to search for, that'd be really great... I've tried searching, and couldn't come up with anything, so I just need a little point in the right direction. Thanks!
Displaying An RTF As An Attachement
I 'm trying to display an RTF document as an attachment, the following code works but it displays only one record. Basically I have created a template for the rtf document which has table structure. here is my code PHP Code:
Displaying Some Records Once Only
I'm building a database via mysql/php which brings back records of events. My problem is that I only want to show the Venue for the event once and then list the events for that venue. ie Code:
Displaying With <br> In The Description
I'm using phpMyAdmin to enter product into my database and I have a description text box that I'm filling in with descriptions of certain products. Some of the description are long and I have just pressed the "enter" key to break up the text abit but when I go and view it it's all mashed together. Is there any way, when the page calls the database for info, I can format the text the same way I put it into the database so it displays somewhat normally on the webpage?
Displaying Php In Html
I have a php search engine script, it works fine and gets results from a mysql database. I was displaying the results in my html pages by way of server side parsing using php include. For some unknown reason after one year of faultless operation (I did not alter anything) it began to parse my results incorrectly. It would parse the wrong id number for data entries. For example it should have displayed id=3456, instead displayed id=17500 which did not exist. I gave up trying to solve this problem and used an iframe to display the php search results. But I have been advised that many visitors could have disabled the display of iframes (iframes are being used to inject malware into visitors computers so more and more they will be blocked) into the browser. Is there any other option to get my php script results to display in my html pages?, could I use javascript to display the results of my php script?
PHP Code Not Displaying In IE 6
I'm a newbie to PHP and am have problems getting simple PHP page (php_test_page.php) to display correctly. The page is: <html> <body> <H1>Test Line 1</h1> <?PHP echo '<H1>Test Line 2</h1>' ?> </body> </html> Test Line 1 displays fine by not the PHP line. If I look at the source with the browser (IE 6), the line is still there. I'm not sure if the following is the problem. I might have two problems here. However, my default web server is not running and I can't seem to start it. The following is the scenario with XP Professional: - Click Control Panel - Click Performance and Maintenance - Click Administrative Tools - Double Click Computer Management - Open Services and Applications - Open Internet Information Services - Open Web Sites - The "Default Web Site" is has a red error sign is marked as stopped. Clicking "Default Web Site" and click "Start" yield an error dialog with the following message. "Unexpected error 0x8ffe2740 occurred."
Displaying Data
Probably a really stupid question to ask, but if i have a number in mysql lets say 180000 and it represents a price is there a way to change that to 180,000 without saving it in the database like that?
Displaying All The Values
I want to display all the values from a colum that matches. Right now i am only displaying the the last value that was inserted in know it has to do with $row['value'] but i am not displaying anything when i do it that way so here is my current code:
Displaying Two Variables
From an Array in a Text Box. Here is what I am trying to do. I've tried several different ways but the page keeps breaking. $data = mysql_query("SELECT * FROM ecampaign WHERE id=2") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { Print " <textarea cols='70' rows='4' name='message'>".$info['header']. .$info['message']."</textarea>";
Counting And Displaying Accordingly
I have a field in my database "number_photos" and lets say for example that number is 4. I want to make it so if # of photos = 4, it will display: photo_0.jpg photo_1.jpg photo_2.jpp photo_3.jpg I was going to use foreach to do this, but it does not work / I don't think it is the correct way. So next I thought I would do: $p = # of photos $p++ To count up - but I need it to start at 0, and also need it to display the photo_0.jpg, etc.
Displaying From Database!
I'm trying to display products that are pulled form a database in a certain way using only DIV tags I would like the products to display across the page in rows of 4, however when i use div tags it is just putting one on each row.. whats the best way to display in a row of 4? here is an example script of what im using to experiment with: Code:
Displaying Images
This page is meant to display all images in a directory. The prob is, it wont display all of them, partly down the page it only shows image names. Also, should I have the page split up? How? Code:
Displaying In 3 Colums
Can anyone see why this won't display in 3 columns? The code looks fine to me but it is displaying in one line. I am using smarty template system. Code:
Displaying 5 Images In A Row
I have spent serveral weeks trying to figure out how to do this. Attached below is code for a function that outputs images in a row. However I am tring to find a way so that it would output 5 images and then drop a line and continue to do this untill all the images have been displayed. The variable which the output is stored in is named $out (towards the bottom). The variable $thumb_row is the total number of images that are allowed to be displayed. Here is an illustration of what I am trying to do the X is an image. XXXXX XXXXX XXXXX XXXXX Code:
Displaying Columns With A Value
what is the most efficient way to display column names from a database that only have the value '1' in its fields?? I cant seem to work it out, could someone give me a code example??
Variable Not Displaying...
Basically on my login page i've created a feature to ban an IP per 30 minutes due to brute forcing, however they have 3 attempts to login before they get banned... I have made a function which will display the number of records, for this 1 IP. basically it will only store 1 record which is not set a ban or expired.
|