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




Locating A Table To Input Information To


my code works properly. But the database connection is failing to find the the table. I am using the code below and the echo message ''error finding database table'' the name of the table is fine. ANy suggestion Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Populating Table Information
I am trying to dynamically generate bgcolors with to help populate some information for a site. Here is the code:

Displaying Information In A 1 Row/2 Column Table
I'm very new to php scripting and haven't quite figured out what I need to do here.

I need to display information in a 1 row/2 column table. I have the MySQL query working fine, but the scripting part in php is killing me!

In the first column a graphic about 70x70 will be shown (plus some additional padding). In the second column will be the description information. The second column will be around 400 pixels wide.

How do I set this up in php? It's easy enough in HTML, but I've about killed myself trying to figure out how to properly lay this out in php!

Hyperlink In Table For Editing Information
What I have is a table with 3 columns, and in the first column, I have it linked to editpost.php? with the id behind it.  I need to somehow get that id into the editpost page to bring up the info in 3 text boxes for the user to edit. Not sure as to how to do this. Code:

Search 2 Fields In A Mysql Table Using Only 1 Input Box
I would like to search 2 fields in a table using only 1 input box in php, at the moment I have 2 input boxes one for the Town search and one for the County searh, I would like 1 input box that would search the 2 fields. Here is my PHP Code:

Creating Hyperlinks From Data Input To Be Display In Table
Ive used search functions and have found relevent thread but the coding does not match. I have a php page the displays records from a form. id  name, address, phone, website etc

I would like to make the website data to turn into a hyperlink once submitted. Here is my following php code that displays the table Code:

Locating Variables In A String
Lets say i have a string of the form... PHP Code:

Locating Speed Bottlenecks In Php
Can anyone share some tips on how to identify slow code in large php scripts?

I have a "wizard" script - index.php, it includes a seperate php file as the user works through each section of the script. Problem is that sometimes it seems to slow to a crawl when loading session data from mysql. I checked my server load, and it is normal.

Any ideas on how I can figure out what is causing the slow down?

Locating NIS Module For PHP 5.1.1 In PECL
The PHP 5.1.1 documentation says that NIS yp_ functions have been moved
to the PECL repository and not bundled with PHP 5.1.1.

However, I am unable to find it on the PECL site.

Locating Root Directory
I posted earlier about finding a directory path from another directory. I tried to find the root directory of the site using the following variable:

$_SERVER['DOCUMENT_ROOT'];

Which I was then going to search to find the appropriate directory. However doc root is not defined on the server i'm using. So my question is this, is there another way to find the root directory and if not how can I set the document root variable? what do I need to change in the server configuration?

Seeking Help Locating A Parse Error
The following script is used to edit information already entered into a MySQL database.

I'm getting a parsing error on line 55. I've been starring at it for a while now, and I can't see what's wrong. I've done some formatting so it's easier on the eyes.

Problem With Locating Image Directory From Root
All i want to do is change my following method that works fine, so that it checks from the root directory.

This is what i originally have and works fine:

$file_name = 'products/'.$pId.'s.jpg'
if (file_exists($file_name))
$test = true;
else
$file_name = 'template/noimage.gif'

I tried changing the following line but it does not locate the image:
$file_name = '../products/'.$pId.'s.jpg'

The folder 'products' and 'template' are in the root directory.
ie. root/products...

$_POST Behavior From Input=submit Vs Input-type=button
I have been trying to solve an annoying behavior with PHP (I think).
Maybe some of you have encountered the same and have some ideas.

I have an html form and I use an <input type="button"> element with
the onClick event that calls a javascript funtion. Once the script's
content has been processed, I execute the form.submit() directive.

I would like to combine the html form and the PHP script into one, and
use action="<?php echo($PHP_SELF) ?>".

When the html form has <input type="button" name="theButton"
value="thisisthetrigger" onclick="doThis(this.form)">but PHP cannot
'read' the value of $_POST["theButton"] after form.submit().

If I substitute the <input type="button"> for <input type="submit">
then PHP reads the value just fine. Some may argue to just use the
latter option, but that will cost me a trip back to the server to
basically do a lot of validation that can be very easily accomplished
on the client side.

Grab Content From HTML Table And Place Into MySQL Table?
I am in the process of helping a co-worker upgrade some of his old static html pages into dynamic MySQL driven pages. He currently has a lot of pages with huge tables displaying data. Does anyone know if there is a script or class that can convert a table to a .sql file for upload?

Table Background Color Based On Results From MySQL Table
I am trying to get the "Did User Agree" field on a database query to be colored Green for "Agreed" Red for "Disagreed" and Blue for "Agreed (2nd Time)" .. I have my PHP setup to do the query just fine as of right now with alternating column colors, just can't seem to get the colors to work as I am hoping for.  Can anyone help me get the Agreed? table's background color to the colors above? Code:

Outputting A Table Or Form Using SHOW FIELDS FROM Table
In the code the MySQL database was queried using "SHOW FIELDS FROM table" which and the returned results of column names was then use to build an output for a form and a table with php using a series of if statements along the lines of if the returned field name matches something echo a text input field.

I have never seen this done this way before, so I want to get the opinion of the devshed user. Does it seem like an unsual long process to build up a form. Is there a security advantage doing it this way? Has anyone ever done it this way before?

Finding Matches In A Table And Then Moving That Match To Another Table?
Ok, I have a database that has a table called critiera in this table
is to fields on is ID and the other is critiera.

Now I want to filter out all the one that don't apple to the list and
move the one that match to a different database.

I know how to open a connection, close, select

but I don't know how I would inside of a database use another one as
the way to create the list of critieras....

Mysql Fetch_field Gets Table Alias, Not Real Table Name
After a SQL 'select .... from tablename alias'
the mysql_fetch_field function returns a value $result=>table which
will contain the alias, not the actual table name.
Is there a way to get the actual table name ?

I am running mysql 4.1 and php 4.4

Grab Data From A Table, Echo, Then Insert It Into A New Table...
I'm trying to do is count the number of times usernames shows up in a table. I then want to reinsert that information into a different table with the Username in column1 & the occurrences in column2 for every user that is echoed on the page. Code:

Using PHP To Sort Data In MySQL Table 1 By Values In Table 2
I have a MySQL database with 2 tables in it. products and prices.. Products has a field in it called 'prodno'. Prices has a field in it called 'prodid'.

There is one of each item in products and each product has it's own unique 'prodno'

There are multiple instances of each product's pricing in prices.. One for each price.. So if a product had multiple prices depending on quantity it would have an entry for each price.. Example:

id = 1
prodid = 7001
qty = 300
price = 12.5

id = 2
prodid = 7001
qty = 400
price = 15.5

I was wondering if I could query the database getting info from the products table but sort it according to the prices in the prices table.

Kinda like doing a "SELECT * FROM products" ordering it by the lowest price value from each item..

This is all very confusing to me, and I'm the one writing it. Let's try one last time..

Query the database selecting * from products (I plan on using all the info in products) and ordering them by the lowest price for each item in the prices table. I've tried sorting the results of just a basic SELECT * FROM products using Javascript and PHP but with pagination in the results it makes it a bit hard.

Update Table While Insert Data To Another Table
it seem like mine coding din work.
[php]<?

include("checkin.html");
$conn=mysql_connect('localhost','root','') or die ('Could not connect to server');
$today = date("Y.m.d");
mysql_select_db('hms', $conn);

$ok = mysql_query("INSERT INTO check_in(ID,room_no,datein)values ('$ID','$room','$today')", $conn);

if( $ok ){

$up = mysql_query("UPDATE studtable SET checked = 'checkin' where [ID] = '%ID');

if(mysql_affected_rows( $up ) == 1)
{
echo'Checked IN!'
}else { echo'No such student to check in' }}
else { echo'Check In FAILED, please check again'}?>[php]

How To Transfer A Data With An Id To Another Table From A Table?
how am i going to transfer let say a name identified using the suer id and copy the name to the other table having the same user id>?

How Can I Find A Name From One Table In A Text From Another Table?
I have one table with a description field and other info, and I also have another table with a list of names and picture url:s. When I display the text description on my site I'd like to know if there are a match with a name from the 'names' table in the text. Code:

Returning Table Name As Well As Fields From That Table
I am returning all fields from news and from regional, however I want to determine where the fields have come from when I ouput the data, therefore I need to return the table name with the fields. Is this possible? Code:

Moving Data From One Table To Another Table
Does anyone know how to move one row from a table in a mysql database to another table using php?

Getting URL Information
Can someone point me to a document anywhere in the Internet where it tells me what are all kinds of information I can get from a URL. Specifically, the ones that are possible to deal with PHP. For example, I can find out the IP address or the URL's host's location.

IP Information
As part of my statistical analysis of the visitors to my site, I record
people's IP address. Is there an easy way to get more information (where
people are from, maybe even long. and latitude) or perhaps translate the IP
address into a named address?



Get Pc Information
How do i get the browser type from the user. I want to display this information on my webpage. I can get  the IP,OS of the user already.

How To Get Information From Url
I am using the get method on my form to send information to my proccesing script, but i don't know how to take the information from the url and so that i can search for it in the database using a piece of code like this, $sql = "SELECT * FROM items WHERE id=$art"; Can any one tell me how to do this.

Get User Information
Hi,

how do i get some information about my visitors?
Things like IP, Operating System,used browser, referrer url and so....

Get Information From Server
I have a script that is used to email a lot of persons in an easy way. You load the script and select a file from your that contains all the email addresses from your own machine. I would like it to be possible to just click a check button or something and load a preset file from the server, this would make it a lot more user friendly (not to mention secure). The problem is that I do not know how to incorporate this in the script.

How To Get Client's Information?
I'm working on a website hit tracking appilication, in php we can use REMOTE_ADDR to retrieve the client's IP address, but how do I get its isp server (domain)?

For example, the domain: pcp08721939pcs.norstn01.pa.comcast.net is associated with IP: 68.32.198.43

How can I use php functions to get 'pcp08721939pcs.norstn01.pa.comcast.net'?

Anyone can help me out?

PHP Cookie Information
How do I read the expiration time for a cookie? I understand that reading the value of a cookie is just $HTTP_COOKIE_VARS["CookieName"] but is there a way to read when it expires?

What I'm trying to do is make a login with a "remember me" option. So if you choose "remember me" the cookie is permanent, but if not it expires an hour after you are done with the admin section of the site.

So I need to keep updating the cookie to expire after an hour, but only if it is set to expire less than an hour from "now".

Sorting Information
I have a script that completes a mysql query and displays all the information & all works fine

The problem im having is that i only want it to display the information i tell it too ie...

there are 3 people with an age of 40 and the rest with various other ages, can someone point me in the right direction to get the script to display only those who are 40 & ignore the rest...

Passing Information
I'm needing to work with a bar code scanner and have come to realize that
after scanning a barcode the unit actually does a hard return. What is the
best way to variables from one page to another. I was thinking of creating
5 pages of for input and the last one would have the submit button. I just
don't what would be the best way to pass the variables from page one, two,
three.. etc to page 5. Thanks for any help you might be able to offer.

PHP Variables Information
I'm pulling a variable out of our LDAP. How can I see the full lenght of the variable? I'm trying to write a script to allow/disallow based on username. It appears when I set the username variable from the LDAP information there is some white space I need to trim.
And if there is, how do I trim in PHP?

How To Get Information From Web Page?
I am now writing a programme that can get information from web page.
That is;
The information which I need is on a page and it will be update now
and again.
So I need to get the information automatically at certain time.

Parsing Information From .asx
I am trying to extract the artist, title, etc. from
this .asx stream: http://www.sirius.com/asx/6lu9ladr/starlite.asx

I understand .asx is Windows code, but I assume this still may be
possible. Where can I begin to figure out how to do something like this?

Extracting Information
Does anyone know where I should start with this. Im trying to extract the
information in:
$_SERVER['HTTP_USER_AGENT'

But I dont know how to get the information out? What functions should I be
looking at. I want to get the OS, Browser, IP etc..

Login And Get Information
I would like to make a script that can log in to another webpage, and
enter a second page, and then get the HTML there, and then save it to a
DB/file.

The login script is like this:

Get The Different Information In A Field
I have a field that has only 4 different information, lets say that the field's name is "color" and it has 4 different information that are: red, blue, green and yellow.
How can i get those 4 or more colors out of the field with PHP?

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".

Getting Information From An Array
I've got a problem with an array, and I'm not sure exactly why my script isn't working.I'm pretty new with arrays, so that could be the reason right there.
My script look like this

function getconfig($getkey){
return $currentconfig[$getkey];
}

In the array, the online key is set to 1.
I am trying to get the 'online' key, so I use getconfig('online'); but it doesn't return anything.If I use print $currentconfig['online']; it prints "1".

Reading MP3 Information
Is it possible within php to read the information from mp3s such as track length etc?

PHP Not Outputting Information
I am trying to pull info from a MySQL dbase with a simple script that recieves info from a get request such as http://mysite/subfolder/index.php?where=Alaska

The code for the request is as follows Code:

Php Collapsible Information?
Would it be possible to create a page using php that basically a user could click on and it would expand to show more information

a bit like the javascript menu's that are available but in php if possible. same sorta thing that clicking additional opptions on creating a post works??

Access Quota Information With Php
Actually i'm looking a way to show email quota information like yahoo di in my squirrelmail

i try to do from shell, ex:

$ du -sh asiah
1.8M asiah

is it possible to show that information to browser with php , since i have try to use :

<?php
$tes= exec("du -sh /mail/raka.com/users/asiah");
echo $tes;
?>

Cannot Add Header Information - Headers Already Sent
I've got this annoying error:

Warning: }Cannot add header information - headers already sent by (output started at c:program filesapache groupapachehtdocsdevadminauth_user.php:2) in c:program filesapache groupapachehtdocsdevadminauth_user.php on line 16

Trying to get my head round this one, but to no avail.

Basically I've got this login script, its a HTML file, and when you login in, and you've not entered anything I've used the header function to re-direct the user back to login section, and if the user if sucessful, I would like them to go to the next section, again using the header function.

Can someone point me in the right direction,

if ((!$username) || (!$pass))
{
echo "Username and Password must be entered";
header("location: http://localhost/dev/admin/login1.html");
exit;
}
$result=mysql_query("SELECT * from user_addition where username = '$username' AND password = password('$pass')");

// check for any results from the query by counting number of rows returned in the result set
$num = mysql_num_rows($result);

// if number of returned rows is more than 1, a match was found
if ($num != 0)
{
echo "1";
header("Location: nextsection.html");
exit;

} else {

echo "INCORRECT";
#header("location: http://localhost/dev/admin/login1.html");
exit;

Website And Tracking Information
i need some information on how you guys would go about making a website that could give you information based on a number you put it. This information will be tracking information on a particular package. The number will be a given number that corresponds with that package. Basically, all the files are dbase files that need to be converted into something readable. I then need to be able to use php or something to search through the readable information from the dbase file and then put it on the screen for the user looking for the tracking information. How would you go about this.

Warning: Cannot Add Header Information -
Everytime i try to use headers on win2k/apache/php4 i keep getting errors. I dont have a clue why i get them.. but anyway, i use this code(from webmonkey):

<?php

// File Name: auth02.php

// Check to see if $PHP_AUTH_USER already contains info

if (!isset($PHP_AUTH_USER)) {

// If empty, send header causing dialog box to appear

header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.'
exit;

} else if (isset($PHP_AUTH_USER)) {

if (($PHP_AUTH_USER != "admin") | | ($PHP_AUTH_PW != "abc123")) {

header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.'
exit;

} else {
echo "
<P>You're authorized!</p>
";
}
}

?>

and when the output i get in my browser is:

Warning: Cannot add header information - headers already sent by (output started at grogram filesapache groupapachehtdocsschildmain_admin.php4:2) in grogram filesapache groupapachehtdocsschildmain_admin.php4 on line 5

Warning: Cannot add header information - headers already sent by (output started at grogram filesapache groupapachehtdocsschildmain_admin.php4:2) in grogram filesapache groupapachehtdocsschildmain_admin.php4 on line 6
Authorization Required.


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