Hello there! I'm new to this forum and I'm new to PHP coding also. I wrote something that doesn't make exactly what I thought it will. Can you give me a hand please. There we go:
Code: [Select] <?php
error_reporting(E_ALL);
$Host = "***";
$User = "***";
$PassWord = "****";
$DataBaseName = "***";
$TableName = "products";
mysql_connect($Host, $User, $PassWord);
mysql_select_db($DataBaseName);
if (isset($_GET['id'])) {
$id = (int)$_GET['id'];
// $select = "SELECT id FROM" . $TableName;
if ($id > 0) {
$select = "select description from" . $TableName . "WHERE id = " . $id;
$result = mysql_query($select);
echo $result;
echo $id;
}
else {
echo "id not > 0";
}
}
else {
echo "ID not set;
}
?>
<p><a href="proba.php?id=1" name="id=1"> Find out more about it. </a></p>
<a href="proba.php?id=2" name="id=2"> Find out more about it. </a></p>
<a href="proba.php?id=3" name="id=3"> Find out more about it. </a></p>
That's a testing page only. What happens here is that only the ID is displayed.
The funny thing is when i add this code to the original page, my apache gives errors on the localhost and i get Quote Premature end of script headers. Obviously I'm doing something wrong, but I don't know what it is. oh, when i run this code on the original page but remove the password, apache is not shoting..
Really need helps regarding Pagination with Sort
I need someone helps regarding pagination problem...i actually want to make my page limited to let say 50 so it will look like this page1=0-50page2=51-100Then i want to sort let say based on the name
$GPRMC and NMEA how to extract from report
Hi There,Im a little bi lost and not sure where to start with this one, ive got a small gps receiver which impolling over a serial connection, each time i poll the device i get a load of rubbish back
Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that I can base everything off one root and work with that, but I'm having a problem with popups
unexpected T_STRING
error log "[Sat Jan 09 18:27:58 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected T_STRING in C:\\web\\htdocs\\Filey\\2.php on line
phph within href not showing php if change ? to &
Code: [Select]<a href="<?php echo $puser; ?>?m=<?php=(($m-1)<1) ? 12 : $m-1 ?>&amp;y=<?php =(($m-1)<1) ? $y-1 : $y
Move array index to end
Hey guys, Quick question: I have an array that looks like this:Code: [Select]$var = array( 'name' => 'thename', 'title' => 'thetitle', 'media'
Error in SQL Syntax HELP!!!
I have this page:Code: <?phpsession_start();//connect to server and select database$conn = mysql_connect("localhost", "root", "") or die(mysql_error());$db =
Problems with adding a link to one position in a 'foreach' loop, please help
Hello!Iam pretty new to programming and I wanna create a table with users from an array. It works just fine but in one table row I wanna add a link to it so I can click on the username to edit it
Does design fit in FPGA ?
Hi all,I've made a large HCC-Design. Because of the program-size the compile process with the handel-c compiler takesvery long. Is there any possibility to find out whether the design fits into my
Login Issue's
Code: <?php $file = fopen('user.txt', 'r');/* Set login to false initially */$login = false/* Break out of loop if login becomes true OR EOF is encountered */while(($login == false)