Ferenc
-
Posts
94 -
Joined
-
Last visited
Never
Posts posted by Ferenc
-
-
[code]echo "<br /><a href=\"display_exhibits1.php?id=".$row['serviceid']."\">" .$row['exhibit']. "</a><br />";[/code]
you needed to fill in the rest, hence the ........ -
You would need to pass id to the second page
[code]<a href=\"display_exhibits1.php?id=".$row['serviceid']."............[/code] -
$row contains all the data for each result so it should be easy to display what you need dynamicly
-
[code]echo "<br />" .$row['row to display']. "<br />";[/code]
displays the record...
ad the link there
[code]echo "<br /><a href=\"where ever you want to go.page\">" .$row['row to display']. "</a><br />";[/code] -
do you understand how the code I posted displays what you want?
-
add the link in the while loop
-
I always forget about range()
-
fill in your db info correctly and this will work
[code]<?php
for ($i = 'A'; $i != 'AA'; $i++){
echo "<a href = \"?search=$i\"> $i </a>";
}
if(isset($_GET['search']) && $_GET['search'] != ''){
// connect to db
$db = mysql_connect('localhost', 'user', 'pass') or die(mysql_error());
$dbi = mysql_select_db('db_name', $db) or die(mysql_error());
$search = $_GET['search'];
$sql = mysql_query("SELECT * FROM table_name WHERE table_row LIKE '$search"."%'") or die(mysql_error());
while ($row = mysql_fetch_array($sql)){
// display results
echo "<br />" .$row['row to display']. "<br />";
}
}
?>[/code] -
<?php
echo $array_name['items']['0']['title'];
echo $array_name['items']['0']['link'];
echo $array_name['items']['0']['description'];
?>
If you need to show each item you will needd to create a loop of some sort -
The backticks where addressed in posts previous to mine.
Since the query was placed in the variable it cannot execute until called.
[code]if (!$result) {
die('Invalid query: ' . mysql_error());
}[/code]
My question to Grega, does the page display an error?
If it does, the query is executed, and the backticks cause the problem. -
$_POST['$submit_information']
remove the $ -
As far as I can tell Your code never executes the query.
[code]$result = mysql_query($query) or die(mysql_error());[/code]
change to [code]mysql_query($query) or die(mysql_error());[/code]
If you need $result you will have to call the query in a if statement, or some other manner -
[code]
<?
if (isset($_POST['submit_data']))
{
// process data
echo "Test completed!";
// end the script
exit;
}
// display form if submit_data was not set
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">...........[/code]
-
the easiest method to send sms is basic email.
You would need to know the service provider for the person you want to message.
AT&T Wireless number@mmode.com http://www.mymmode.com/messagecenter/
Cingular number@mobile.mycingular.com http://www.cingular.com/sendamessage
Nextel number@messaging.nextel.com http://messaging.nextel.com/
Qwest number@qwestmp.com http://www.qwestmp.com/
Sprint PCS number@messaging.sprintpcs.com http://messaging.sprintpcs.com/
T-Mobile number@tmomail.net http://www.t-mobile.com/messaging/
Verizon number@vtext.com http://www.vtext.com/
The problem you will run into would be replys. -
You cane use $_GET, or $_REQUEST to aquire the id passed in the URL
[code]$job_id = $_GET['detail'];
// query database
$sql = mysql_query("SELECT * FROM job_details WHERE id = '$job_id'"); [/code] -
Your code is fine, something is not right with your server if it isn't working for you.
-
[quote] 1. PHP has a low barrier to entry.
2. PHP costs nothing to deploy commercially.
3. PHP has all of the documentation needed to learn it efficiently and correctly.
4. PHP has a universally recognized certification for professionals.
5. PHP has a track record of success in all scales of successful enterprises (even if those enterprises don’t like to admit it).
PHP 4 was certainly at least as effective as ASP 3-4, JSP, Cold Fusion and Perl.[/quote]
Here are some links to a few case studies...
[url=http://phplens.com/phpeverywhere/node/view/15]http://phplens.com/phpeverywhere/node/view/15[/url]
[url=http://www.zend.com/zend/cs/#CaseStudies]http://www.zend.com/zend/cs/#CaseStudies[/url] -
You need to echo $options_t within the while loop.
while ($row=mysql_fetch_array($result)) {
$id=$row["id"];
$value=$row["Type"];
echo "<OPTION VALUE=\"$id\">".$value.'</option>';
}
why it doesn't display the first record is because $options_t changes with each query ( 2 entries in the database = 2 queries) . when not displayed within the loop it has to display the last result -
try using the whole path
mkdir("/home2/buy7net/public_html/folder/work", 0777); -
this line is causeing the error...
[code] <form method="post" action="<?php echo $PHP_SELF?>">[/code]
the echo needs to terminate ;
[code]
<?php echo $PHP_SELF; ?>[/code]
The lack of a curly brace will cause a "Unexpected end on line ###" error.
-
Yes, that is much easier...
-
$sql = "SELECT * FROM members";
$result = mysql_query($sql)or die (mysql_error());
// get the total
$total = mysql_num_rows($result) or die (mysql_error());
// get a random id from the data base..
// begin for loop
for($i = 0; $i < 5 ;$i++){
$rand = rand(1,$total);
$sql .= " WHERE ID = '$rand'";
$rand_sql = mysql_query($sql) or die (mysql_error());
while ($output = mysql_fetch_array($rand_sql)){
echo $output['membername']."<br>";
echo $output['location'];
}
// end for loop
} -
[!--quoteo(post=386059:date=Jun 20 2006, 09:46 AM:name=ben_stringer)--][div class=\'quotetop\']QUOTE(ben_stringer @ Jun 20 2006, 09:46 AM) [snapback]386059[/snapback][/div][div class=\'quotemain\'][!--quotec--]
hah ill try that thanks m8
exelent thnaks you just one last thing how can i do it so it dose it 5 times??
selects the random id 5 times and echos all 5 results?
thanks -ben
[/quote]
place it in a for loop
for($i = 0; $i < 5 ;$i++){
//code to display 5x
} -
Something like this would work, as long as the id's are numerical, and don't have gaps in them (1,2,5,6 will error periodicly).
[code]<?php
$sql = "SELECT * FROM members";
$result = mysql_query($sql)or die (mysql_error());
// get the total
$total = mysql_num_rows($result) or die (mysql_error());
// get a random id from the data base..
$rand = rand(1,$total);
$sql .= " WHERE ID = '$rand'";
$rand_sql = mysql_query($sql) or die (mysql_error());
while ($output = mysql_fetch_array($rand_sql)){
echo $output['membername']."<br>";
echo $output['location'];
}
?>[/code]
File upload issues
in PHP Coding Help
Posted
[code]<?php
echo "test1.jpg:<br />\n";
$exif = exif_read_data('tests/test1.jpg', 'IFD0');
echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";
$exif = exif_read_data('tests/test2.jpg', 0, true);
echo "test2.jpg:<br />\n";
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
echo "$key.$name: $val<br />\n";
}
}
?> [/code]