Hey! I'm quite new to this whole thing, so please don't fire me with shait on this one =D
I'm trying to learn PHP and MySQL, and atm I am trying to make a website which corresponds with a database - a database with customers.
I managed to make the page show all the customers in the database - with first- and surname.
I want each of these customers to be clickable - when you click a customer, it shows all the information about that customer which is stored in the database.
So far I have managed to make them clickable, but I don't know how to make it so that the click posts all the associated information about that customer on the page..
I can post some of the stuff I tried out with, but I'm not good with PHP (yet! =D), and therefore I got stuck quite early... but here's some of the stuff I've done so far..
Code: <?php
// Connect to the database server
$dbcnx = @mysql_connect('localhost', 'root', 'password');
if (!$dbcnx) {
exit('<p>Unable to connect to the database server at this time.</p>');
}
// Select the database
if (!@mysql_select_db('customerdb')) {
exit('<p>Unable to locate the database at this time');
}
?>
<p>Here are all the customers:</p><br />
// Request data from the database
$customers = @mysql_query('SELECT * FROM customers');
if (!$customers) {
exit('<p>Error performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($customers)) {
$customerID = $row['kundeID'];
$customer_forename = $row['forename'];
$customer_surname = $row['surname'];
echo '<p>' . $customer_forename .
$customer_surname .
' <a href="' . $_SERVER['PHP_SELF'] .
'?showcustomer=' . $customerID . '">' .
'customer details</a></p>';
}
?>
Thanks!
help with mysql_error()
Hi,I am trying to insert data into a table, but I am not able to insert it. I wanted to see what the error was using mysql_error() function, but it does not return any error string for me. I have
CURL question
i am wondering if it's possible to use multi curl with login something likelogin once to website and after that use multi curl to download several pagesthank you
Help with php code
Hello, can anyone tell me why this php word trap fails to work, and the trigger words get blow right past, and the comments get posted anyway?heres the php code im testing on a
explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searches for the second word. For example: if I typed london zoo , it will only search for zoo.Is this
Problem displaying "scraped" XML data
I'm basicly having trouble displaying XML data scraped from an URL using cURL.What the code should do:Using Curl the code should "grab" the xml data from a specified URL.It should then
Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of the same email. I know I need to do an IF statement but I am kinda foggy on how to do the code.What I
How do I send data using an html link
HiIf I have <a href="main_file.php">How do I send data to main_file.php I have a group of links that are created on the fly and I want to give each link a value so that I can
Hom to make one url to open together with another url
I have a chat, which i want to be opened, as soon as the users login to the site. As it is now, when the user login, he's redirected to home.php and have to press the CHAT button to enter the chatThe
Stopped working!
So I had to change some stuff, none of it major. Stuff like the extension_dir and such. BEFORE I did much, I had that code working fine. Then I did some changed... well a lot of changes that I cant
MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,