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




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.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Recall
is there a possibility to recall a page in which I had entered a
password before with a hint that it was the wrong password.

Php_sqlite.dll Recall?
I have been trying to download the file php_sqlite.dll in order to use
Sqlite with PHP4. However, everywhere I find an alleged link to it, the
file has appearently been removed. Here are example sources:

http://us3.php.net/sqlite

http://www.zend.com/manual/ref.sqlite.php

Has it been yanked from the shelves for some reason? Perhaps it is a
fire-wall issue that does not like "dll" extensions? Can anybody else
by chance download the file from those links?

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.

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:

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?

Recall A Function Inside A Loop
I'm running through two arrays making sure the values do not match
each other and if one value in array b does match a value in array a,
what I want to happen is:

foreach($arrayb as $key => $value){
if($value == $array[$getrandnumb]){
$getrandnumb = getrandnumb($result);
// I want to recall this function to get another number
// but it needs to jump OUT of this foreach loop so it can then
// be run again.
$taken = 1;
} else {
$taken = 0;
}

}

How can I do this?

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:

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. 

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.

I Need Info...
I want to write a very simple PHP script that just picks random images from a directory, you know what i mean. So I'd like to know where I could find information about this in the PHP manual maybe?

PHP - SSL Info
How do i know if ssl has been enabled in a WAMP configuration using PHP ?

Looking In $var For Certain Info
I pulled certain collums from my database. The value of the collums is either Y or N. I want to figure out on each $var how many Y's there are. I don't care how many N's.

At the end I'm going to add up all the Y's of all the VARs for stats. Whats the best way of counting Y's in a $var?

Getting Users Info
I need to get the following information,

User's IP
User's Browser
User's Screensize

What is the code for any of these as I can't find it in the PHP manual.

Getting Info From A .dll File
How can i get information from a .dll file using the power of php.

How To Get Header Info
I've been trying to extract the status codes from http header information to find whether a page is 200 ok or 404 not found by using an fsock() connection which works. To actually extract the data what do you use? i've seen fputs() and fgets() listed on the documentation page but how do these function actually work?

Info From MySql DB
Problem : I have a table in mysql with titles as such :

ShipIDNameMcostCcostBuildETA(there are more)

I run the query :

for($i=1;$i<=9;$i++){
$query = "select Name, Mcost, Ccost, BuildETA from ships where ShipID=$i";
$result = mysql_query($query)
or die("Query failed");

I want to refer to "Name", "Mcost", "Ccost" and "BuildETA" so i can use them to build a table. So i need to assign them to variables in an array so i can loop to make a table with as many rows as there are "ShipID"'s. The thing is that all the ways i have tried of refering to individual column names have failed.

PEAR/Info.php
I tried to use Example 49-1. Using PEAR_Info

This is not showing PEAR installation information on local/remote server.
What I see local, I've no file Info.php in package PEAR in PEAR directory.
I've installed PEAR, why this file is missing?

My Web host say, they've installed PEAR, and I can use PEAR.

Getting Info Into A Object..
I'm sitting and trying to understand this OOP - and need to create a
class wich can do the following..

ShowBlocks() - Displays the data wich is inside it - If empty creates a form
wich sends the info back to the Object, wich show the stuff..
AddBlock( $type ) - Creates an empty blok - wich is addet to a blocks area
object...( Or somethin like it )
Store() - safes the info into a file, and updates mySQL...

I have figured out most of the stuff but the way to get the empty block ->
creating form with some different strings/textbloks and a file -> putting
stuff into object -> now showing what its looks like and aking if i want to
add a extra block....... now showing x blocks then asking if i want an extra
block - i haven´t got a clue of how to do it !

Does anyone of you have an example with an object thats goes : See im a
empty object -> here you can put an line into me -> see im not empty now (
showing the string) do you want to add an extra line ? - ect ect..

Help Need Php Security Info
I need to put on a demo of a php security flaw and how to fix it. Can anyone
point me in the direction of a good doc and fix example ...

Getting Caller Id Info
I am developing an application where I need to read the caller id
from an incoming call. The only info (for now) I need is the caller id
info, so that I can display the propper caller info on screen if so
desired.
I was thinking on using asterisk (asterisk.org) for this with
appropriate 2FXO/2FXS card but I do not know if this is just overkill
(asterisk for this). Do you know of any other solution/way of getting
the caller id and passing it to PHP?.

Getting Info From A Website.
I have been doing PHP for over a year now but when I came round to
writing a script I discovered that there was a reasonably sizeable gap
in my knowledge that I didn't even know where to start finding out
about. Anyway this is a reasonably nooby question:

If I have a script on http://url-a.com/script.php and I want to get
some dynamic information of my friend's site at
http://url-b.com/info.php , How can I get it? I need to use get
variables in getting it and it must also be server side.

Drawing Info From D/b
I'm trying to get sum info from my database, but its only returning the first record, and not any after that Heres my code: PHP Code:

Php Form Info...
have a form, with a text input "fieldname".
method POST

$var = $_POST["fieldname"]

$var is then used to search in mysql

select * from table where jobtype like '$var%'
OR jobtype like '%$var%'
OR jobtype like '%$var'
OR jobtype like '$var' order by date asc;

basically i'm doing a search for any string that matches the searched
input, being at the beginning, middle or end of the jobtype column.

query works great, except when the string contains the 4-letter word
'info' such as information or informative
then the mysql query breaks down and give the usual:

Error performing query: You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'ORDER BY date ASC' at line 1

Now after much debugging, i found out that the php _POST variable
treats anything with info as a numner of 0 value.
inf is treated as text, nformation is treated as text, but anything
with info gets a 0 value.

Searched php.net and couldn't find anything related to this feature,
looked under security to see if it was related to that, but nothing.

User Info
How can i be able to show a users profile after they have logged in of course? But i dont want a user to edit another users profile. I am using sessions.

Php Form Info...
have a form, with a text input "fieldname".
method POST

$var = $_POST["fieldname"]

$var is then used to search in mysql

select * from table where jobtype like '$var%'
OR jobtype like '%$var%'
OR jobtype like '%$var'
OR jobtype like '$var' order by date asc;

basically i'm doing a search for any string that matches the searched
input, being at the beginning, middle or end of the jobtype column.

query works great, except when the string contains the 4-letter word
'info' such as information or informative
then the mysql query breaks down and give the usual:

Error performing query: You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'ORDER BY date ASC' at line 1

Now after much debugging, i found out that the php _POST variable
treats anything with info as a numner of 0 value.
inf is treated as text, nformation is treated as text, but anything
with info gets a 0 value.

Searched php.net and couldn't find anything related to this feature,
looked under security to see if it was related to that, but nothing.

Can anyone look into it and elaborate?
create a form, then echo the value of the $_POST variable
and try words that contain info in them.

Verify Info Was Placed In Db...
Hey, i am having trouble finding out how i can verify that the data that i inserted into my db realy got there, and if it did to redirect me to another page. and if the data didn't get inserted to re-direct me to a diffrent page.

Browser/OS Info
Is it possible to make (or find if one is premade) a php file that will check the users browser and operating system info and see if they have things like the flash player installed (and check the version on that too), then if they need it, open up links to the pages where they can update?

I'm totally fine with having to go out and find the pages to update stuff and manually set variables for the most recent versions myself, I just need to know it its possible to check all this information and process it this way.

I'm Getting The Same Row Of Info Repeated
I need to access data from a database and repeat the display for how many rows there are...Well I figured out the whole repeat thing I just can't make it go to the next row when it outputs... Code:

Pulling Info
Here is what I I am trying to do.

select * from table where fname='fname' order by 'time_sent' desc <-- This works

what I am trying to do is:
select * from table where fname='fname'  and opened='y' and opened='n' and opened='r' order by 'time_sent' desc <-- This doesn't work :(

the entries in opened are

y, n, r, a

I only want it to pull y,n,r and list them where fname='$fname' only

I tried googling for a solution with very little luck.  Anybody have any ideas how I can accomplish this?

Retrieve Info Via Id
How can I retrieve data from my database based on the item's id and how can I built it up on one page dynamically?

Cannot Write Info To DB
I had this script working for a couple days and was fiddling around with it, which now has me unable to write the form data to my db table.  The email confirmations are still being sent without any problems but the data isn't being stored. I'm sure it's something simple, but I'm still new to this and just can't see it. Code:

Enter Info Into Mysql
I am relatively new to PHP and MySQL and I am testing a simple form that is not working:

Getting Mysql Table Info?
Suppose I have a table with name 'tablename' in my database.

If I have no idea what are the contents of this table, is it still possible to retrieve the structural info in this table, like the field names and sizes?


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