Hi all,
Sorry if this is simple, i'm very new to php, well, any programming language actually.
My code runs a query and comes back with the results. Very rarely there may be more than one result.
I have added the code that I think should enable me to go to the next and previous records but it is not working. I have tried lots of different bits of code so now its all over the shop!
Can you help please?
Jamie
Code: [Select]<?php
//run ext query
require("conf.php");
{
$udf_form = $_POST['udf'];
$extract = mysql_query ("SELECT * FROM cy_equ WHERE udf = '$udf_form' LIMIT 1 ");
$numrows = mysql_num_rows ($extract);
while ($row = mysql_fetch_assoc($extract))
{
$id = $row['id'];
$equ = $row['equ'];
$ext = $row['ext'];
$udf = $row['udf'];
$udf2 = $row['udf2'];
$udf3 = $row['udf3'];
$next = $udf + 1;
$prev = $udf - 1;
}
}
$next = $udf_form + 1;
$prev = $udf_form - 1;
?>
<div class="boxextqry">
<h3> UDF Query </h3>
<form name="form1" method="post" action="../index1.php?page=udfsearch">
<p> Input UDF: <input type="number" name="udf" size="1" maxlength="4"/></p>
<p> ID = <font color="red"><?php echo $id; ?> </font> </p>
<p> EXT = <font color="red"><?php echo $ext; ?> </font> </p>
<p> EQU = <font color="red"><?php echo $equ; ?> </font></p>
<p> UDF = <font color="red"><?php echo $udf; ?> </font></p>
<p> UDF2 = <font color="red"><?php echo $udf2; ?> </font></p>
<p> UDF3 = <font color="red"><?php echo $udf3; ?> </font></p>
<p><input type="submit" name="submit" value="GET DATA"/></p>
<p><input type="submit" name="udf[<?php echo $next?>]" value="NEXT"/></p>
<p><input type="submit" name="udf[<?php echo $prev?>]" value="PREV"/></p>
</form>
</div>
Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.Code: $moderators = array('Admin', 'banana', 'orange');if (in_array("{$_SESSION['user_name']}", $moderators)) print('Found it!');i
Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database assigns an ID number. The front end displays each upload by ID number. I'm trying to set up the back
how to configure ADS in ABAP instance
Hi All,
Structure Question - One Table or One Table Per Record Set?
I have a web app (mySQL and PHP) which allows people to create an item with up to 200 records which I store in a single table. Any user subscribing to that item will be pulling up to 4 records from
pointer 102 question
I read a book
mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscribe to a news letter . Those who subscribe will receive a monthly email. They can unsubscribe using
PHP Search Issue
Hi, I am using the following code to search and return flights from a database. The user searches by inputting a DepID and an ArrID and I want to display only flights that match both DepID and ArrID.
Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:
Grouping and sorting results
Please help with this query.I have 2 tables in a database, countires and cities. states looks like thiscountriesid -----------country1 ------------uk2 ------------us3 ------------japancitiesid
Do not allow posting of whitespace
Currently the script below works if the user does not type a name/message, but if i create a whitespace with the spacebar, it will submit. How would I fix this?message page:<?php// Get the