Retrieving Info From A Database
I would like the code below to fetch and display in an html table the Ad_Id, Date, and Type_Job fields from the 1st 10 rows of a table called employment. I'd like the results to be sorted first by date and then by the Ad_Id #. I have replaced my username and password with "user" and "password". Currently, the script returns the error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Also, the script is ignoring the css info that I have supplied. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Retrieving Database Info Based On User
I'm still quite new to php and mysql but I have been unable to figure this out. I'm attempting to display a specific row and column from a mysql database based on the user. $result = mysql_query("SELECT fbleague FROM users WHERE username = $_SESSION[username]"); fbleague is the column users is the table username is the primary key column $_SESSION[username] is the username variable Then later I try to display it with echo "You are in league $result "; I know $_SESSION[username] is set correctly because I can display that with no problems.
Retrieving Flash Info In PHP
Does anyone know how to retrieve Flash info in PHP? Meaning, I need a script to extract the framerate of a SWF file. Is this possible? How to read flash file's headers, as framerate is probably in the header?
Retrieving Info From A Whois Query
Can some one give me a little step by step to put me onthe right way.. I'd like to use PHP with Postresql. I need to make many whois query on the domain names that we own, to store the information such as expiration date and so in our DB. I was thinking of : using php to open the url of the query, retrieve the new web page with ftp mode, parsing the page with some "expression régulieres" and then uploading the found data in my DB... Can you tell me what you think of that, is there any way to be quicker and easier, and maybe some advice on how to retrieve and parse the file.. because I dont really know how to..
Retrieving Specific File Info...
Ive got a file which contains the following data: <option value="13">African Nations Cup XXV</option> <option value="16">asd</option> <option value="7">Champions League</option> <option value="1">English Premiership</option> What Id like to do is get the maximum value, so 16. Ive used file_get_contents to bring the file into a string, but now Im stuck getting that max value out. Unless theres a function for this, I believe the direction I would need to take is collect all value numbers using some string manipulation function, throw them all into an array, and just get the max value of the array. Is there an easier way?
Retrieving Database
User choose on ID and submit. I use the URL query method to get the ID and rest of the profile like first_name, last_name, I tried something like this $query = "SELECT * FROM user where user_id= $ID"; echo $_get['first_name']; but it doesnt show, how come?
Problems With Retrieving Url From Database
I am having problems with retreiving the url of the avatar that the user chose, which is stored in a database, and then diplaying it as an image. I have no prob's with the query:
Retrieving Values From The Database
I am retrieving a value from the database and I insert the value as a value of a field The problem is that when the value has spaces then in the filed is viewed only the part of the value before the first space. If the value is not includes any spaces then the value appears in the field correct.
Dates In Database + Retrieving
What is the best way to store dates into database so the data can be retrieved later on. For example: I use this to get the date and i store it. <?php $date = date('d/m/y'); ?> However, if i wanted it to say '20 March 2007' would this be easy or is there a better way to store them.
Problem Retrieving Results From Database
I'm trying to retrieve fields from my database with following mysql statement: $query = SELECT g_games.Title FROM g_collections, g_personal_reviews, g_games WHERE (g_games.ID=g_personal_reviews.G_ID AND g_collections.U_ID = '" . $data1['ID'] . "' AND g_personal_reviews.C_ID = '" . $data2['ID'] . "' ) "; $resultset = mysql_query($query); $data = mysql_fetch_array($resultset); 3 Rows in my database comply with the above statement... though I only get 1 to show up on my php page? How can I show all of them? This is the php code I'm using to write the results: while ($data= mysql_fetch_array($resultset)) { echo $data[Title]." "; } My tables are as followed: g_games g_collections g_personal_reviews > this table connects all others with G_ID ("game ID"), C_ID ("Collection_ID"), U_ID ("User ID)... users
Retrieving PDF/MSWord Files From Database
I am able to upload .pdf and .doc files into the MySQL database (using Medium Blob) but I can't retrieve or download them back. Can you help me download them? What I did was the following pages (downloadpage.php and downloader.php):
Retrieving (Data + Fieldnames) From Database To Array?
I'd like to poll a database and get the table contents, as well as the field names from that table. I've been to php.net but this time I cannot find something helpful. I can get the data, and retrieve it into an array noproblem. [1] I can get the data+fieldnames and put it into a list. [2] But I cannot seem to be able to fill an array with the data *and* the fieldnames. If you check both chunks of code, you will se what I'm doing....
Recall Database Info
Hi, I want to create a page where users can put in certain information like you normialy would in a form but when they click submit another page will load that will look like the original form the signed up with and everything they filed in that time will be there and they can make changes to that and then click submit and the changes are made to databse automaticialy.
How To Send Info To Database
im wondering how to submit info into a database. i know the code goes something lie $sql = "UPDATE <tablename> set $var = "var" but i know that is wrong and i want to put it in form so on submit it posts it in the database.
Info Deleted Itself From Database?
I got some info (news system) in a SQL database but after some days it deletes by itself it happened to me once but i thought i didnt remembered that i deleted it but today it happened again...it deleted by itself! lol I have other tables in the same database so its a table problem... How can i fix this? Did i miss something at the table configuration?
Get And Insert Info Into Database
I have one table (form) that has multiple fields. Here are few fields we need to know: ID, NAME, CITY, STATE, PROFESSION, x, y, z (x, y, z means more than 50 fields that give me more information about each name). The ID and NAME are unique and they don't change (each name has it's own ID). A NAME and its ID can be in any CITY, STATE or PROFESSION but this is fixed. That means if ID# 123 for Mr JOHN is Austin, TX, that will stay in Austin, TX for ever. I have more than 5000 NAME and it's ID, 9 professions, all US States and all Cities in my database. Here is what I need to do: I want to have a form on my site that my visitor finds his name first and then enters more information about him/her that will complete my database fields of x,y,z. What I'm thinking to do is to create a drop down list that the visitor first selects the profession. Based on the profession the second list shows the states that has that profession. Then by selecting the state, all the available cities will show up in the third list, and by selecting the city all the names related to that profession in that city, state will show up and he can select the name from the forth list. Then he enters other required information about him that will be send and saved in the database. Here is what I have done and I know to do so far: I have created the database with all the information in one table. I also know how to send data to database to be saved. But my problem at this point is how to create this list selection that narrows the search to find the right person.
Populating A Form Wth Database Info
I've coded a piece of code which populates a form with data read from the database: $connection=mysql_connec ("localhost", "f2821842", "f2821842"); $result=mysql_select_db("QUERIES"); $query=mysql_query("Select * from Emp_Details where emp_num = '$employnum'"); while($row=mysql_fetch_array($query)) {$empname=$row['emp_name'];} <form name="webregform" action="webadmin2.php" method="post"> <input name="requiredname" type="text" size="30" value="<?php echo "$empname"; ?>"> </form> When I echo the $requiredname, I get spaces and no data, and I know that $empname is not a space-it does read a value in a database. 1. How can I get $requiredname to print a value?
Ordering Info Returned From Database
I have a PHP page on my site which pulls back info from my MySQL database and displays it in a table under appropriate headings. Is there code that I could add to these headings so that a) the same page could be redisplayed with the information sorted by the third column instead of the first b) information in the columns could be displayed in reverse order (maybe Z to A or highest figure to lowest figure)
Session Variable Info To Database
I have a 2 page form. The first page page of the form POSTS to the 2nd page which, after being filled out, should send all the information (from pages 1 and 2) to the database. I have created a session variable and have placed it at the top of the 2nd page. For brevity´s sake I have placed only one of the variables in this example: <?php session_start(); $_SESSION["sessanimals"] = $_POST["animals"]; ?> After filling out the remaining variables on page 2, I want all the information (the info from page 1 brought over in the session variable and the info from page 2) sent to the database. I tried creating an INSERT RECORD on page 2 but only the variables on page 2 are subsequently sent upon submission. How do I get all the info into my database?? Here are a list of my questions: 1. Is there any way of creating one session variable for all my page 1 form variables (I have 20+ variables)? 2. is there a way to denote ALL the variables in = $_POST[]; or do they have to be listed separately? 3. How do I post all the data from page 1 and 2 into my database at once?
Insert Form Info Into Database
i am trying to enter info from a form into a mysql database. when i submit the form, a new row is created, but the information isn't contained in it? any thoughts? PHP Code:
Filling Form With Database Info
I have a table with 5 fields for a tour business activity list : (1) id -table key (2) name (3)description (4)picture -text link not binary(5) country. I would like to create a form that takes all the activitys an puts it neatly down on site in checkboxes so user can select activtys.this will be linked to form mail.i would like the activitys to be seperated by the country they r in?
Update Database Info Using Forms
i have a page uses select and cases. i already have setup and working, auth/login to the page, create a new row in the table. i am now trying to have the user alter the information that the just put into the table. this is the code where i have setup to modify the info, $id is passed over. this puts the correct information into the form field. when i hit submit, the information, $name, $content, $id are not passed over. echo-ing results blank. PHP Code:
Hiding Database Connection Info
In a php script, I have to connect to a remote mysql database. I'm a bit worried that some user might be bale to retrieve the source of the page and see the user name and password to connect to the db. Is this resonable? What's the best way to avoid it?
Obtaining Info From Database Table
How do you obtain fields from a table and assign each field to a variable to be used as needed. An example: Say i had: table name : user Field 1 : User name Field 2: Password then i wanted: $username = field 1 $password = field 2.
User Info Not Posting To Database
I am trying to figure out why my script isn't updating the information of the user names stored in the database. Can anyone give me the solution? Below is the script: Code:
How To Obscure Database Info In PHP Pages
I'm moving from Cold Fusion to PHP and I have a question that none of the books I have answers adequately: In Cold Fusion, database connection parameters like the table, username and password are configured on the server. Since they are at the backend, nothing is exposed on the page except the queries themselves. In PHP, from what I see, the database info is on the page. Is this not a security risk? How can one be sure that this info is not on the page sent to the user?
Validating Form Info Before Inserting It Into Database
I have been trying to create a PHP application where you can add customer contacts to a MySQL database. Now, my problem began when I created a form where the user can add in a customer's name and info to the database. In an effort to alert the user that they may be adding a customer that is already setup in the database, knowing that some of the customers may have the same names, e.g. there is more than one Bobby Ray Brown, I decided to add a script that queries the "customers" table in the database and searches for all results that match the input from the user. Code:
Entering/checking Info Into Mysql Database
I have set up a client database where one can view, add, edit and delete entries. I ran into a problem setting up the add page. On this page i have set up forms to add info into the DB, and it works fine, but i dont want duplicate clients. Is there a way to set it up so that when you submit the form with the info it checks for duplicates and if there is one returns "sorry this record exists?"
Retrieve An Image In Folder From Info Out Of Database
i am having problems displaying an image once i have uploaded it. i upload it to a folder and store its name in a database. below is the code to display the image. I have figured out the the code is not grabbing the name from the database but i can not figure out why. can anyone help? //Retrieves data from MySQL $data = mysql_query("SELECT IMAGE_NAME FROM item") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { //Outputs the image and other data Echo "<img src=http://www.abcxyz.com/pics/".$info['photo'] ."<br>"; }
Sends SMTP Mail From Database Info
I've got this script that I want to use to send SMTP mail from a form that allows the user to select recipients from a dropdown list that is created using database info and send a message. Two of the selections in the dropdown list are groups. My script works fine when the user selects only one recipient. I run into trouble when the user selects one of the two groups. The message ends up getting sent numerous times to the people in the group. I received the message 9 times. I think the script is looping more times than it should. Does this make sense so far? Here's the script that receives the form data and connects to the DB to get the recipient email addresses and then sends the message: Code:
Uploading Info From A Text File Into A MySQL Database
what would the PHP and SQL code be to say basically: make a new row and put this in the field, what comes after each comma goes in a new field, and each new line should be a new row. I have a huge text file that i don't have a way to upload directly into a MySQL database because my webhost isn't allowing it for some reason.
Upload & Query MySQL Info Database With Image Files
I want a database I can enter information and upload a photo from a web form. Then I want to query that database for the text info with its related photo and display it (formatted) in a browser (html). Summary: 1. upload photo's and text information to database with my add article form. 2. Query the database and page the results with the text and related photo. It comes in three parts: 1. add_article.php [Text / Photo Upload Form] 2. insert_article.php [Inserts into database] 3. articles.php [View Output] Here is what I have this far:
Putting Info Into A DB / Passing Info Between Pages
I have run into an issue...I have posted previously, but my scenario has changed. Here is the situation... If a user clicks on a link ('abc123' for example) I want to insert into my database some predefined information about 'abc123' - I have assigned a value that is echoed in future pages for 'abc123'. So, what I need is some mechanism to, when a user clicks 'abc123', have a pre-defined username and password be entered into the database. I need this so future pages can utilize the session values.
Retrieving HTML
I was working on php script that could pull content from another site, and post it on mine. Some of the HTML from the site is not needed and I would like to remove it. How would I remove some of the HTML but keep that part that I need?
Retrieving NT User ID
Does anyone know how to retrieve the NT user id that someone is logged in as? System is running IIS. Have tried HTTP_AUTHENTICATION but that doesnt appear to work under MS - unless someone knows a works around. Alternatively - how can I retrieve a UNC pathname for a specific drive mapping.
Retrieving Records With Between
I am trying to convert my asp website to php. So far so good, but I am having a problem with my SQL Statement that needs to us the Between. Here is what I am using: $sql = "Select * From tblTrack Where DateEntered Between $start and $end"; the vars start and end come from the same form. I don't have a problem when I hard code the dates, but when I use the variables, it won't retrieve anything.
Retrieving URL's
I'm assembling a search spider, and codes from other search scripts look way to hard to understand, so I'm assembling one right now. My question is, could someone show me a very brief example, of how to get all the URLS into an array. Then I just use for() or foreach(), but then I need to know the function to get the file size in kb. How would you do that if you were to use a directory?
Retrieving Full Url?
Is there any way to pull from a variable of some sort the full address in the browser. Including any get variables currently there?... I ask because I have a number of different things, filters and such that should be compounded on each other. example. user has selected to filter a page by some field, user name or whatever depending on the data, then they choose to delete a record... etc. there are many uses i see, very possible with a lot of tweaking, but i thought there might be an easier way.
Retrieving InnerXML In PHP DOM
I'm trying to return the inner XML from a DOM element, but I can't find any methods that allow this. For example, if I have a string: <TEXT>Here is a string with <B>bold</B> text in it</TEXT> then I want to return the enclosed string _including_ the <B> tags: "Here is a string with <B>bold</B> text in it" Using get_content strips out the tags. "Here is a string with bold text in it"
Retrieving A Zip File
I'm doing a sort of download center. Where the user fills out their details and then chooses the program they would like to download and the information is then entered ito a log file. So all this information is fed into a send.php file. What I'm looking is for the send to go to a thank you page and get the file that the user has requested. Code:
Retrieving Information From URL
I want to make it easier for a user to get to a comment on my page and to be able to go directly to that comment when it is typed into the URL. For example, instead of this: http://www.mysite.com/comments.php?id=1 I want them to be able to do this: http://www.mysite.com/1 I am just wondering how to retrieve the "1" from the url instead of having to type id=1 and store it into a variable. I know that the second one is pointing to my homepage instead of comments.php, and thats fine. I am just going to redirect to the other page or include the other page after I retrieve the "1".
Retrieving Max Numeric Value.
I can't see anything wrong with this code at all. Trying to retreive the last(highest) id from the text_id column which is auto-increment and primary key. The conncetion to the DB is fine and working. It appears that the result isn't being drawn though... any ideas? Code:
Retrieving Field From Mysql With Php
I want to select as in the code, an email matching a username, and after I want to make a variable called $email_a to send to this user an email. What is the way to retrieve the email address from the database and insert it into the variable? $query = "SELECT email from users WHERE username = '$username'"; mysql_select_db($db_name); $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error());
Retrieving Cookies (Opera)
I have a script which sets a cookie which is a history of Mysql queries a person has tried. My problem is that when I run a query 'show tables' when I retrieve that value from a cookie it is stored as 'show=' instead of 'show tables'. This only happens in Opera. Everything is fine in IE and Netscape.The script is in Python but I am hoping someone using PHP has had a similar problem.
Retrieving The CLient IP With Php4.2
I am runing php 4.2 on an apache server. I'v tried several things in order to get the ip address of my visitors, the problem is none of them work. I'v looked over the phpinfo() output several times and found nothing that would provide me with that info also I tried several examples using getenv() and none of them seemed to work. I remeber doing this easily with older versions of php. What changed?
Retrieving NT Logon Name For PHP Authentication
I am in the process of developing an web-based helpdesk system for our Intranet, I would like it if the user did not have to logon to the helpdesk system, but was automatically logged in using the username they logged onto the network with. I'm pretty sure this is possible with PHP, but just haven't discovered how for our setup. Running Apache w/PHP (not our NT server), users use both Win95 and 2k.
Retrieving Hyperlinks From Access
does anybody know a simple way of retrieving a hyperlink from an acces table. After retiving the data array with odbc_fetch_into()the hyperlink is returned as "hyperlink name#..path of document#. maybe sombody has already solved the problem and can save me hours of programing.
|