Linking To Update Database In Printf Statement

I have the following statement:

printf("<tr><td class="ltgrey">%s<td class="ltgrey">%s, %s</td><td class="ltgrey">%s<td class="ltgrey">%s<td class="ltgrey">%s</tr>",

$myrow["client"], $myrow["last"], $myrow["first"], $myrow["phone"], $myrow["email"], $myrow["url"]);

and wish to have the client displayed as a link so that a user can clik on it to update the information in the db. How can i do this?


Printf - Warning: Printf() [function.printf]: Too Few Arguments

what im doing wrong? PHP Code:

mysql_connect("localhost","goc2d_Audio","*****") or die ("Cant connect to db");
    mysql_select_db("goc2d_main") or die ("Cant select db");
    $result = mysql_query('SELECT * FROM `news`') or exit(mysql_error());
    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
        printf ('
        <table width="95%" border="1" cellspacing="0" cellpadding="0">
        ', $row[0], $row[1]);

Warning: printf() [function.printf]: Too few arguments in /home/goc2d/public_html/delta/index.php on line 38

it works fine if i leave the table as <table>

View 1 Replies View Related

Cross Linking - Any Entry In Other Database Also Appear In My Database Automatically?

i am intersted to build a database and want to link it with other data base in sach a way that any entery in other database also appear in my database automaticaly.

View 1 Replies View Related

Use Commit The Statement After Each Update Statement?

Should I use commit the statement after each update statement?Is it a good practice to do it.

foreach ($array as $key => $value)

View 5 Replies View Related

Update Statement Doesn't Update?

I have a form which passes 3 values x 14 instances to a processing page. I am getting the arrays of the variables and am able to echo to screen to check that the pairs of values that I want are there.  This all works OK. Then I have an update statement which should go to the sprcified table, update the column with the values from the arrays where the condition is met.

However, it just isn't updating.  I don't get an error message unless there is a problem in the code (I set one to check it, then took it out).My code is below, could someone please look and tell me if they can see the problem.  I connect to my database by calling a connect file, which is correct as it is getting the information for the form page correctly.  I'm going cross eyed looking at it now.

Code: [Select]<?php
//database connection

View 4 Replies View Related

Database Record Linking

I develop websites on the side, it is basically a hobby. An organization has approached me to develop a site for them which I may or may not take depending on one thing. This organization would like individuals within their organization to be able to access their individual information via a password protected area.

The information will contain their hours worked, hours needed for next level, credits earned,and test scores.The individual should only be able to access their information only. I use MS Front Page, and NetObjects. Is this possible with these programs and if not what is reccomended?

View 1 Replies View Related

Linking A Txt Database With Script

i've just learnt html and designed my website. Part of the website has a project where i am trying to design a simple music store that, when a visitor clicks on an appropriate page creates a list of cassette titles headed by artist name, price etc from the stock that has been entered into a database. I had a similar system i created in frontpage that used a asp page to call on the data.

That worked but now my servers dont support micrsoft extentions and i no longer use frontpage in preference to using notepad and html.

I found a scrpt on the web that was supposed to work but doesnt quite. i think there must be an error in the script but i dont know enough about the language to sort it out.
I wonder can anyone spot whats going wrong? Code:

View 1 Replies View Related

Linking Database Tables With CSV?

I have two tables.  Let's call the first one items and the second one item categories.  Now the items table would look something like this:

id(auto_increment id)

The item categories table would look something like this:


An entry in the items table would look something like this:

categoryid = 1,2
name = Thing
description = something
id = 1

Say I want to retrieve records that contain "1" in the categoryid column.  How would I do that?

View 1 Replies View Related

An Insert Query, Linking Do Database?

searched and found allot of results with this heading but not with my problem exactly, I'm creating an Insert Query with php, I'm linking do my Database with no complaints.Here is my complete php code for the sql insert query

Code:$link = mysql_connect('', 'root', '');
$sql="INSERT INTO `orders` ( `invoicenr` , `company` , `store` , `userid` ,
`username` , `email` , `500cards` , `500amount` , `1000cards` , `1000amount`


As i say this works when I insert directly with phpmyadmin, I don't know what to look.

View 4 Replies View Related

Linking Words From A Mysql Database?

Currently on my website I have a section where you can select an article held within a database, I still want this to happen but I wouldn't a different word to be linked to the article. Currently it reads 'Click here to view this entry' underneath the title of the article, I want he title of all the different articles to link to the right article is there anyway to do this?

My code currently reads:

Code: [Select]<?php
$blog_postnumber = 5;
if(!isset($_GET['page'])) {
$page = 1;


View 2 Replies View Related

Linking Each Foreach Output Individually From Database?

I'm almost finished reading through Build Your Own Database Driven Website Using PHP and MYSQL by Kevin Yank (really informative book) and I have a question. When I'm outputting data from a database list with a Foreach statement how do I make each output link to it's individual page.

For example.[URL].. Here you click on a letter and there is a dropdown list of all the Anime corresponding with each letter and each of the titles goes to their own individual page. How do I go about coding something like this, having each output link to it's own page? I'm trying to do something similar only with classic games.

View 3 Replies View Related

Linking Database Selected Through Dropdownlist With Mysql?

linking database selected through dropdownlist with corresponding database in mysql via php

View 2 Replies View Related

Friend Image - Kinda Linking Database?

Right i want to have friends displayed on peoples profiles but i can only ave there name and not the avater displayed here is the code ive got which doesnt work

$picture = mysql_query("SELECT * FROM users WHERE username = '$dip->person'");
$pc = mysql_fetch_object($picture);
$query_friends=mysql_query("SELECT * FROM friends WHERE username='$viewuser' AND type='Friend'");
if ($rows == "0"){ echo "<center>No friends</center>"; }
$friend = 0;


The friends are from the friends database and the avater is from the users database how can i link them so the name and the avater show ive tried this but only the names are displayed and the avaters dont show

View 2 Replies View Related

Search Script - Linking Results To Database Records?

I'm using a simple search script to pull results from a MySQL database on a site I'm working on. The search itself is working fine, but I'm having problems tweaking it to link the results listings to a display of the full records from the database - the search is on a book catalogue and the search results page shows only the title, author, and ISBN, and I want users to be able to click on the title as a link to go to the full listing for the record.This is the main part of the script as I have it at the moment:

$query = "select * from books where ".$searchtype." like '%".$searchterm."%'";
$result = $db->query($query);
$num_results = $result->num_rows;[code]....

After much faffing around trying to get the concatanation right I eventually figured out that to make the title clickable to take the user to the full listing, I needed to change the 'title' line in the code to:

echo "<a href=\"view.php?itemid=".stripslashes($row['itemid']).">".htmlspecialchars(stripslashes($row['title']))."</a>";

That does work, and takes the user to a record, but it seems that in adding the link it messes the search up somehow. Say for example I try searching the 'author' field for "George" - at the moment with the test data I've got in the database, a search on 'george' should bring up two records for George Orwell - one for 'Animal Farm' and one for '1984'. Using the original script without modification, that's indeed the result I get, but if I modify the title field to include the link, though the results page tells me there are 2 matching books, only one is displayed (though it does have a clickable title and takes me to the full details for one of the books).I've also tried adding in an extra 'itemid' field thinking maybe trying to pull two different fields in one echo wasn't working right (though I can't imagine how that would make a difference) and tried linking the 'itemid' field. The same thing happens with that. If I echo just the books 'itemid' the id # for the book displays on the page just fine, but if I try and link the id to the full record, again using the George Orwell example above, the results page tells me there are 2 results, but only one result displays (though again the 'itemid' for that book is clickable, and takes me to the full details, but the other result doesn't display on the results page).

Somehow it's adding the link in that's messing up the results, but I can't figure out why, and why the results display okay with the script as it is, but don't if I try and link a result to its full record.

View 3 Replies View Related

Create An External To Gather The Information From The Database And Linking Work?

Create a PHP page that will display the content of each of the fields of the customer table of the warehouse database. Save the file as task3.php.The following code will be helpful (you will need to refer to the database table description above to determine the names of the fields that are not included in the code below):

<title>Prac 3 Task 3</title>
$conn = mysql_connect("localhost", "student", "prac3");
mysql_select_db("warehouse", $conn)

I dont understand what im supposed to do.I know how to use php in forms, but ive never used mysql and php. How do i create an external php to gather the information from the database?Can anyone tell me how the linking works?Doing it in one file is easy,but how do u link it with an external file?

View 2 Replies View Related

Update Statement

I have hit a slight problem - I have an update statement as follows:

$conn->Execute("UPDATE units SET $res = $newrescost WHERE ID = $x");

The problem is that it comes up with an error about the syntax - I am sure I have everything covered that I need to though. The statement works but I have a text box which appears for each resource for the unit which I want to edit - it only shows the first one,

then if you click it and hit enter it shows the first 2, then the first 3, then all 4 (there are only 4 resources in this game at the moment). Can anyone see what the problem could be, given that $conn is the connection to the database, $res is the resource name taken from the resources table, $newrescost is the new cost (written into the textbox) and $x is the ID of the unit to be edited?

View 7 Replies View Related

PHP/SQL Update Statement

i'm having some problem with my update statment. Here is a form with disabled and prefilled fields. Every field has an edit button. Form.php(bottom of page) doesn't update the table. Is the statement wrong? Im sure that "Seinfeld" is in the database and kunde is the correct table.

Could it be the disabled/prefilled fields causing the problem since they have an initial value? I edited fornavn(firstname) and etternavn for updating. After the update it should print to screen that the update is done, this never happens so clearly the statement isn't working. I tried using insert with empty table and that worked no prob. Code:

View 5 Replies View Related

Use Hyperlink Update To Update Values Inside Mysql Database Via Textboxes?

how yo use hyperlink update to update values inside Mysql database via textboxes .

View 3 Replies View Related

Update Multiple Items In A Database - Update Query Not Working

I'm trying to write an update query so i can update mulitple items in a database, but it aint working.. Ive used the mysql_error() thingy, but it still does not display any errors. All it does is nothing, the web page doesnt update, and neither does the database in MySQL. Is the syntax wrong or what?

<h1>Update Items</h1>
<p>Update items below.</p>
$db_host = 'X;
$db_user = 'X';
$db_pwd = 'X';

View 9 Replies View Related

Create / Update File When Update The Database By Submitting The Form

I have some data in database, i need to create/update file when i update the database by submitting the form

1) the file must contain all the content in database
2) each time i generate or update the record, it must update(or rewrite on the file all the record + new record)

View 3 Replies View Related

Update Statement Not Effective?

if (!mysql_select_db($database))


The script will edit and replace the field with new information gained by input. It will echo Success as expected, but the row hasn't changed.

View 2 Replies View Related

Update Statement Does Not Display Anything ?

my update statement, it does not display anything

$sqlString = "UPDATE cms_users SET email = '$email', passwd='$passwd', name='$name', Address='$Address', TelNo='$TelNo', MobileNo='$MobileNo', Job_TItle = '$Job_TItle', Positions = '$Positions' where user_id='$user_id'";

or die("Error in query $sqlString" . mysql_error());

View 10 Replies View Related

UPDATE Prepared Statement?

I have a problem with UPDATE prepared statement, looked everywhere, browsed through questions here, and the syntax seems to be right, what am I missing?

$update_page = $db->stmt_init();
$update_page = $db->prepare ("
UPDATE pages

View 2 Replies View Related

Update SQL Statement Not Working?

I have this page that outputs information into a table of rows. On clicking edit, it allows the user to edit the data in that row and press update, I have echoed out an "Update successful" statement after the SQL update query which is placed inside an IF statement so as far as i can see the SQL is executing but not updating my table.


$host = localhost;
$user = bw001500;


View 7 Replies View Related

Update Statement With Querystring

I have the code below where i want to update fields in my database. Now i know the insert statement does work because i have tested it with test data. But when i do the following:-

$update_thread = "UPDATE threads SET thread_message = '".$_POST['txt_subject']."' WHERE thread_id =" .$_GET['thread_id'];
$add_member = mysql_query($update_thread);
$update_post = "UPDATE posts SET post_message = '".$_POST['txt_subject']."' WHERE thread_id =". $_GET['thread_id'];
$add_member = mysql_query($update_post);
header("Location:" .$_GET['post_id']. "&thread_id=" .$_GET['thread_id']);

It does not pick up ANY of the lines that have this .. $_GET['thread_id']

View 6 Replies View Related

Update Statement Only Working Once?

don't understand why the update statement only works once.. and after it rolls another 6, it wont add aother 500 to the RP amount.


View 7 Replies View Related

Update Statement Getting An Error?

syntax error, unexpected T_VARIABLE, expecting ',' or ';' in ds.php on line 6

This is my code

View 3 Replies View Related

How Does The UPDATE Statement Work

I have found that the tutorial I was using and basing my UPDATE statement does not work and the answers I have gotto so far, I am sorry to say, I do not understand.

I have a number of PHP books available to me but they skirt over the update issue

So please anyone could you point me to a tutorial  where I can select a simple record from a file display the fields and update the file with any modifications.

View 1 Replies View Related

Variables In The Update Script And Update The Record In The Database?

The query to call the record works and when clicking submit it redirects correctly and echo's (record updated) but the database is not updated.change the value variables in the update script it correctly updates the record in the database.



View 6 Replies View Related

Update Any Piece Of Code To Update A MySQL Database?

Whenever I try to update any piece of PHP code to update a MySQL database, nothing happens. I have tried copying in some of the working codes of a website and tried the same, but no success. I recently installed XAMPP. I am connecting using the correct user id and pass to the database. The scripts are not giving me any error, but just not connecting, that's all.

While making such a usage as noted below <FORM name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >

I get the following error Firefox can't find the file at /C:/xampp/htdocs/="<?php..  so on

Why does this happen?

View 2 Replies View Related

Dynamic Update/insert Statement?

I'm hoping to build a dynamic sql statement for inserts and updates based on FORM values. I've done this in ASP but not sure about PHP syntax. Right now I just output the form entry results, but here's what I'm thinking for an update: PHP Code:

View 11 Replies View Related

Copyrights 2005-15, All rights reserved