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>
UTL File problem
Hi
Class not found error
I am getting Class 'index' not found in Eval function://write config $path = dirname(__FILE__).DS.'..'.DS.'paymentclass'; if ( $model->payment_class ) { if
How to use Ajax to verify data on a DB ?
Hello everyone, well i want to know how to check a value if it exists or not on a Data base and capturing this without making postback (no click on a button or other control) ofcourse by using Ajax,
gmdate() - want 1 hr before time
Hi,I am using php gmdate(). Now I am entering all dates in my dbase using gmdate("Y-m-d H:i:s")I want 1 hr before datetime.So am using like gmdate("Y-m-d H:i:s",
Creating a function
Basically i wanna put all this code in a seperate file Code: <?php $query = "select product.ProductID, product.ProductName, product.ProductCategory,
Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL should they view a preset number of pages. I'm a little concerned with the speed in which this
how to get IP address?
hey guys,i have this code which is supposed to get me the IP address of my site visitors:Code: <?php if ($_SERVER['HTTP_X_FORWARD_FOR']) {$ip = $_SERVER['HTTP_X_FORWARD_FOR'];} else {$ip =
Displaying a record from mysql in a simple swf file
Hi,I have a mysql database containing information I would like to display in my swf. Using php can anyone explain how I might do this?I just need to understand the basics so I can develop it
I think i'm using the syntax incorrectly
Hi Everyone!I'm new to this forum and a newbie with PHP - I'm glad I found this site - I hope to learn a lot! For my first and hopefully one of few questions, lol..I told my boss i'd help him out
Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year changes ?