phorce 131 Posting Whiz in Training Featured Poster

Firstly because you are using a form.. Make sure you declare your using one:

<p>Please select the product you want to add 
<form method="post" action="test.php">
              <label>
              <select name="menu1" onchange="MM_jumpMenu('parent',this,0)">
                <option>Nylon Blisters</option>
                <option>PP plastic</option>
                            </select>
              </label>
              <input type="submit" name="submit" value="Update">
</p>

This code will just display the results of the form input.. But you can use '$name' to update your database:

<?php
	
	$name = $_POST['menu1'];
	
	echo $name;

?>
phorce 131 Posting Whiz in Training Featured Poster

Click on the 'Mark this thread as solved' Should be near the 'Quick reply box' =)

phorce 131 Posting Whiz in Training Featured Poster
<?php

   session_start(); // this initializes the session, and, should be on each of your main pages that you use        
                           //    sessions.
   $_SESSION['string'] = "Hello, this is a string";

  echo $_SESSION['string']; // this outputs Hello, this is a string.
?>

- Hope this helps :)

phorce 131 Posting Whiz in Training Featured Poster

I think the problem is with the "===" I am not a PHP expert, but === means that the values and variables are the same for it to be true, try "==" and see if that works.

That's the way I view them =) ..

<?php

	$num = (int) 4;
	$num2 = (string) "4";
	
	if($num === $num2) // will print "no"
	{
		echo 'Yes';
	}else{
		echo 'No';
	}
	
	if($num == $num2) // Will print "Yes"
	{
		echo 'Yes';
	}else{
		echo 'No';
		
	}
?>

:)

phorce 131 Posting Whiz in Training Featured Poster

Hello, now it looks like this is homework help, but no - it's not!

I'm trying to communicate between a C# program and a webpage, I'm generating the data into C# and wanted to export it to the webpage using JSON.. However, I can't seem to find out if it's possible to encode JSON in C#, are there any libraries out there?

Would be really grateful for any help =)

phorce 131 Posting Whiz in Training Featured Poster

Just make sure you do checks on it, if your using $_GET, for sql injections etc =)

phorce 131 Posting Whiz in Training Featured Poster

Sorry, that was my fault ;)

You'd create your artist.php and insert your code into it.

ONLY edit .htaccess if you want to have such a url like www.site.com/artists/thekooks/ (I believe this is how you get urls like this, but i'm not too sure) =)

So basically, every time the artists.php is ran, it will execute that code!

phorce 131 Posting Whiz in Training Featured Poster

Hey =)

I'm going to suggest a way (I think the way you want to do it, it is possible but with some .htaccess)

Basically, your URL would be something like:
- www.thesite.com/artists.php?name=thekooks
OR
- www.thesite.com/artists.php?id=1

and then you'd have a script that looks something like this:

<?php
	$name = $_GET['name'];
	
	echo $name; // This will output what's after the "=" in this case, thekooks
?>

BUT if you want to fetch data from a database, you could do something like this:

<?php
	$name = $_GET['name'];
	// connection information
	$query = "SELECT name ... FROM artists WHERE artist='$name'";
	$result = mysql_query($query);
	if(mysql_affected_rows() >= 1)
	{
		// display the results
		
	}else{
		echo 'No such band!';
	}
?>
phorce 131 Posting Whiz in Training Featured Poster

Like this:

<?php
 
if(!isset($_POST['txtapplied']))
{
    echo 'You have not completed this field';
}else{
  $posapp = $_POST['txtapplied']; 
}

if(!isset($_POST['txtfname']))
{
  echo 'You have not entered your first name';
}else{
  $fname = $_POST['txtfname'];
}
// etc
		$mname = $_POST['txtmname']; 
		$lname = $_POST['txtlname']; 
		$month=$_POST['txtmonth'];
		$day=$_POST['txtday'];
		$year=$_POST['txtyear'];
		$age=$_POST['txtage'];
		$eadd=$_POST['txtemail'];
		$homenumber=$_POST['txthnum'];
		$cpnumber=$_POST['txtcpnumber'];
		$address=$_POST['txtaddress'];
		$religion=$_POST['txtreligion'];
		$birthplace=$_POST['txtbplace'];
		$height=$_POST['txtheight'];
		$weight=$_POST['txtweight'];
		$civilstatus=$_POST['txtcstatus'];
		$college=$_POST['txtcollege'];
		$course=$_POST['txtcourse'];
		$yeargrad=$_POST['txtyeargrad'];
 
		$db=mysql_connect('localhost','root','') or die ('Cannot connect to MYSQL!');
		@mysql_select_db('dbriomra') or die('Cannot connect to database');
 
 
		$query="INSERT INTO onlineapplication (positionapplied, firstname, middlename, lastname, month, day, year, age, emailaddress, homenumber, cellphone, address, religion, birthplace, height, weight, civilstatus, college, course, yeargrad) VALUES ('$posapp', '$fname', '$mname', '$lname', '$month', '$day', '$year', '$age', '$eadd', '$homenumber', '$cpnumber', '$address', '$religion', '$birthplace', '$height', '$weight', '$civilstatus', '$college', '$course', '$yeargrad')";
 
 
  //$result = mysql_query($query); 
 
  if(mysql_query($query))
        {
         header('Location: oapp_finished.php');
        }
        else
        {
         echo "<br> Problem Loading";
        }
 
       mysql_close($db);
?>

I'd also do further checks, this is just an example =)

phorce 131 Posting Whiz in Training Featured Poster

You could..

if(!isset($_POST['txtapplied']))
{
    echo 'You have not completed this field';
}else{
  $posapp = $_POST['txtapplied']; 
}

Do it for all of them =)

phorce 131 Posting Whiz in Training Featured Poster

No problem :) Please mark this thread as solved and give rep points to those who have helped you (Click on the arrow buttons by their name) - Best of luck :)

sakarora commented: good +0
phorce 131 Posting Whiz in Training Featured Poster

Finished :) Thank you for everyone who replied. I solved it by using preg_match() function

phorce 131 Posting Whiz in Training Featured Poster

Yes, but that's not the question you originally asked.

What do you want to leave - just letters, just letters and numbers, how about accented letters and multibyte characters (ï) etc?

OR

What do you want to strip? spaces, commas, semicolons, colons....

How about underscores and hyphens?

There are quite a few ways to use preg_replace() with this, we need to know exactly what to include or what to exclude.

The text just has whitespaces, commas and full stops.. I'll have a look at preg_replace :)

phorce 131 Posting Whiz in Training Featured Poster

Ahh thank you for your reply, I've done it now (kind of)..

The problem is that, I'm reading from a text file and I want it to read the contents but ignoring all of the punctuation marks and spaces.. Here's the code:

$encrypted = "encrypted.txt";
$open = fopen($encrypted, 'r');
$string = fgets($open, 30);

echo $string; // prints "This is a test."

And I just need it to print "Thisisatest"

Any ideas? =)

phorce 131 Posting Whiz in Training Featured Poster

Hello, having a slight problem here..

I have a string, that I need to do character analysis on - Basically finding out how many times "B" is in the text and then ordering this from (lowest to highest). Now I can get the results, but, I don't know how to sort them. Any ideas?

<?php
		$string = "This is a test.";
		
		foreach (count_chars($string, 1) as $i => $val) {
		   echo "There were $val instance(s) of \"" , chr($i) , "\" in the string.\n";
		}
		
?>

And the output would be something like:

String: T H I S I S A T E S T

Obviously not actual results but you know :)

Hope it's descriptive enough!

phorce 131 Posting Whiz in Training Featured Poster

This compiles for me:

I left the class functions (.cpp) file alone and the main but changed the class to:

#ifndef CHARACTER_H
#define CHARACTER_H

#include <iostream>
#include <string>
#include <vector>
class Character
{
       public:
        Character();
    
   private:
    
    int health;
    int magic;
    int level;
    int eyeColor;
    std::vector<std::string> inventory;
    std::vector<std::string> abilities;
    
};

#endif

Hope this helps :)

phorce 131 Posting Whiz in Training Featured Poster
<?php
	$id = (int) 1;
	
	$db=mysql_connect('localhost','root','') or die ('Cannot connect to MYSQL!');
	@mysql_select_db('dbriomra') or die('Cannot connect to database');
		
	$query="SELECT * FROM `profiles` WHERE txtempno='$id'";
	$result = mysql_query($query);
	
	if(mysql_affected_rows() >= 1)
	{
		echo '<form method="post" action="">';
		while($row = mysql_fetch_array($result))
		{
			echo '<input type="text" name="field" value="' .$row['txtename']. '">';
		}
		echo '</form>';
	}else{
		
	  echo 'There are no records to fetch';
	}
?>

Should return a value =) I don't know why you're posting stuff if you want to display something in a text box.. e.g:

<?php

$empno = $_POST['txtempno']; 
$empname = $_POST['txtename'];
$position = $_POST['txtpos']; 
$salary = $_POST['txtsal']; 
$aname=$_POST['txtaname'];
$address=$_POST['txtadd'];
$relation=$_POST['txtremp'];
$age=$_POST['txtage'];
$sss=$_POST['txtsss'];
$ph=$_POST['txtph'];
$pagibig=$_POST['txtpagibig'];
$tax=$_POST['txttax'];
$total=$_POST['txttotal'];
$sss2=$_POST['txtsss2'];
$ph2=$_POST['txtph2'];
$pagibig2=$_POST['txtpagibig2'];
$tax2=$_POST['txttax2'];
$total2=$_POST['txttotal2'];
$tded=$_POST['txttded'];
$tsal=$_POST['txttsal'];
$allotment=$_POST['txtallotment'];
phorce 131 Posting Whiz in Training Featured Poster

-stares blankly- :P

Ok, ok

I'm guessing this is one of your field names "empno"?

So you could correct the code like this:

<?php
	$id = (int) 1;
	
	$db=mysql_connect('localhost','root','') or die ('Cannot connect to MYSQL!');
	@mysql_select_db('dbriomra') or die('Cannot connect to database');
		
	$query="SELECT * FROM `profiles` WHERE empno='$id'";
	$result = mysql_query($query);
	
	if(mysql_affected_rows() >= 1)
	{
		echo '<form method="post" action="">';
		while($row = mysql_fetch_array($result))
		{
			echo '<input type="text" name="field" value="' .$row['empname']. '">';
		}
		echo '</form>';
	}else{
		
	  echo 'There are no records to fetch';
	}
?>

I asked for your field names, not your code.. You need to be more descriptive with your problem, otherwise it's hard to help you.

phorce 131 Posting Whiz in Training Featured Poster

The entire line is correct, it has to be one of the three variables being passed to mysql_connect(). Or privileges for the user. A simple way to check this is to log into the SQL Server directly using that password and username.

If you are able to log in with them details and the Database is on localhost, there might be another problem of the PHP not being able to talk to the database. Check the port numbers in php.ini file match the ports that the database is listening to, and the location of 'mysql.sock', is where the php.ini files tries to look for it.

Manual for mysql_connect()

But the line of code looks fine.

Just looked at the line again, it's confusing but it looks to be okay.. My bad ;) it's late!

phorce 131 Posting Whiz in Training Featured Poster

What error does it give?

It was just an example since I don't have access to your database, I cannot tell what fields you have.. =) Maybe provide some extra details?

phorce 131 Posting Whiz in Training Featured Poster

Right, well, you can't SELECT everything and expect EVERYTHING to display in a text box (Well, you can, but it's not practical lol):

<?php
	$id = (int) 1;
	
	$db=mysql_connect('localhost','root','') or die ('Cannot connect to MYSQL!');
	@mysql_select_db('dbriomra') or die('Cannot connect to database');
		
	$query="SELECT * FROM `profiles` WHERE profile_id='$id'";
	$result = mysql_query($query);
	
	if(mysql_affected_rows() >= 1)
	{
		echo '<form method="post" action="">';
		while($row = mysql_fetch_array($result))
		{
			echo '<input type="text" name="field" value="' .$row['name']. '">';
		}
		echo '</form>';
	}else{
		
	  echo 'There are no records to fetch';
	}
?>

This example selects everything from the table profile, where the profile_id is 1 and if there is a record, displays a text box that has the value of the name.. For example "Phillip"

Hope this helps :)

phorce 131 Posting Whiz in Training Featured Poster

I'm confused to what you actually want to do here..

Do you want to display a record inside a text box, so like have an input box and its value is from the table?

OR display a record from the table onto a page?

To me, your code suggests that you're passing data from a form, selecting every record from the table, checking to see if the query executes..

phorce 131 Posting Whiz in Training Featured Poster

But surely:

$conn = mysql_connect("host","username", "password") or die ("Could not connect MySQL");

To me, your connection string is wrong and therefore cannot connect :)

phorce 131 Posting Whiz in Training Featured Poster

Could you please explain this:

$conn = mysql_connect("localhost","rentwall_rentwal",")[B]X7zlBx)XgZ5"[/B]) or die ("Could not connect MySQL");

What is X7zlBx)XgZ5?

phorce 131 Posting Whiz in Training Featured Poster

Could you please give us the code so we can try and resolve your issue :)

phorce 131 Posting Whiz in Training Featured Poster

They are really easy to get your head around!

Best of luck with your project =) If this thread is solved, please mark it that way and add rep points if you think someone has helped you!

:)

phorce 131 Posting Whiz in Training Featured Poster

Just a suggestion but because you're using a menue, why not use a switch statement instead?

For example:

#include <iostream>
int x;
int y;
int z;
void addFunc();
void subFunc();
void divFunc();
void multFunc();
using namespace std;

int main()
{
    int select;
    cout << "Welcome to calculator!" << endl << "You have four options" << endl << "Type 1 for add." << endl << "Type 2 			  for subtract." << endl << "Type 3 for divide." << endl << "Type 4 for multiply." << endl;
    cin >> select;
    
	switch (select)
	{
		case 1:
			addFunc();
		break;
		
		case 2:
			subFunc();
		break;
		
		case 3:
			divFunc();
		break;
		
		case 4:
			multFunc();
		break;
		
		default:
			cout << "Your number was not between 1-4";
		break;
		
	}
    return 0;
}

void addFunc()
{
    cout << "Choose a number to add." << endl;
    cin >> x;
    cout << "Choose another number to add" << endl;
    cin >> y;
    z = x + y;
    cout << "Your answer is " << z << endl;
}

void divFunc()
{
    cout << "Choose a number to divide." << endl;
    cin >> x;
    cout << "Choose another number to divide" << endl;
    cin >> y;
    z = x / y;
    cout << "Your answer is " << z << endl;
}

void subFunc()
{
    cout << "Choose a number to subtract." << endl;
    cin >> x;
    cout << "Choose another number to subtract." << endl;
    cin >> y;
    z = x - y;
    cout << "Your answer is " << z << endl; …
PrimePackster commented: Nice one.... +0
phorce 131 Posting Whiz in Training Featured Poster

If this has now been solved, please mark it as solved and give rep points (use the arrows next to someones name)

Thanks and good luck :)

phorce 131 Posting Whiz in Training Featured Poster

I don't get what you mean by "put it into a function", but I'll have a go :)

<?php

   function returnText($theText)
   {
   		return $theText;
   }
   
   if(!isset($_POST['submitted'])) { // check that form hasn't been submitted 
      echo '<form method="post" action="">';
      echo 'Enter something: <input type="text" name="theInput" value="" />';
      echo '<input type="submit" name="submit" value="Go!">';
      echo '<input type="hidden" name="submitted" value="TRUE" />';
      echo '</form>';
   }else{
   
   	  $text = $_POST['theInput'];
   
   	  echo $text; // this will display the text.
   	  
   	  echo returnText($text);
   }
   
 ?>
phorce 131 Posting Whiz in Training Featured Poster

Is this solved now? If so, mark thread as solved :)

phorce 131 Posting Whiz in Training Featured Poster

What is the problem with using sessions?

But to answer your question, I shouldn't think so if they cannot add items to the card (because, these will be stored within the session) so aslong as the visitor to your site can only browse and doesn't have to do anything "usery" then sessions can be kept clear, for now.

You'll obviously need to use them when the user signs in and stuff :)

phorce 131 Posting Whiz in Training Featured Poster

I think you're asking in the wrong forum category if I'm honest. If you ask in a C# coding forum, the likelihood is someone will attempt to throw code at you, why not ask in the Computer Science or something where someone can help you further?

phorce 131 Posting Whiz in Training Featured Poster

Just a suggestion, might be wrong but sure mail features is turned on? I had this problem when I was working on my own server, like WAMP or MAMP.

phorce 131 Posting Whiz in Training Featured Poster

Okay.. So full code:

<?php
	// This is the form have an array of all the people
	$people = array (
				'Phillip' => 'picture.png', 
				'James' => 'picture1.png',
				'Harry' => 'picture2.png',
				'Justin' => 'picture3.png',
				'Mark' => 'picture4.png',
				'Sally' => 'picture5.png');
				
	echo '<form method="post" action="theForm.php">';
	
	foreach($people as $person => $key)
	{
		echo '<button name="vote" type="submit" value="' .$person. '"><img src="' .$key. '"></button><br />';
	}
	echo '</form>';

?>

and the php:

<?php

	$name = (string) $_POST['vote'];
	
	$vote = "UPDATE images SET vote=vote+1 WHERE Username='$name'";
	$voteRes = mysql_query($vote);
	
	if(mysql_affected_rows() == 1) { // only 1 row should be affected
	
		echo 'Vote has been submitted =)';
	
	}else{
	  echo 'There is something wrong :(';
	}
	
	

?>

Obviously, include your sql connection - I haven't tested cos I don't have the table but looks right :) Let me know how you get on!

GreaseJunkie commented: Most helpful person over here! +2
phorce 131 Posting Whiz in Training Featured Poster

Right can you try this then:

<button name="vote" type="submit" value="Person1"><img src="<?php echo $img; ?>"></button>

Different to <input type="image"> and should process..

=) -- updated: wrong input xD

phorce 131 Posting Whiz in Training Featured Poster

I don't think it's supported in FireFox.. ?

Will your voting be dynamic, in that, the images will change? Why not just have radio buttons or have two images that have their own ID and then increment it that way?

phorce 131 Posting Whiz in Training Featured Poster

Your SQL statement should read:

$conn = "UPDATE images SET vote = '$name'  where 'Username' = '$Username'";

And no, you're var_dumping the variable and not the query.. The variable is null because "name" isn't declared

<input type="image" name="vote" value="person1" src="<?php echo $img; ?>" alt="<?php echo $alt; ?>" />
<?php
$conn = //DB Connection

$name = $_POST['vote'];
$Username = ($_POST['Username']);

$conn = "UPDATE images SET vote = '$name'  WHERE Username = '$Username'";
?>

Sorry.. My server is down and can't run it but try that :)

phorce 131 Posting Whiz in Training Featured Poster

From what I can see, "name" isn't recognised (I might be wrong)..

Your input needs to have a name, and the value needs to be what you process, for example:

<input type="image" name="myImage" value="Phorce">

And then in PHP:

<?php
 $name = $_POST['myImage'];
 var_dump($name); // Should display "Phorce"
?>

Hope this helps, might be wrong.. Haven't ran the code :)

phorce 131 Posting Whiz in Training Featured Poster

Me personally, I wouldn't have like inputs etc inside the class methods e.g:

void student::getdata()
{
		char ch;
		cin.get(ch);
		cout<<"\n\n\t\t\tEnter the roll number: ";
		cin>>r_no;
		cout<<"\n\t\t\tEnter name:";
		cin>>name;
		cout<<"\n\t\t\tEnter class:";
		cin>>classs;
		cout<<"\n\t\t\tEnter the marks:";
		cin>>marks;
		if(marks>=75)       grade='A';
		else if(marks>=60)  grade='B';
		else if(marks>=50)  grade='C';
		else if(marks>=40)  grade='D';
		else grade='F';
}

This should be in main, and, your class should store just the pay roll number, name, class and marks and then another method that calculates what the mark was and returns this accordingly.

Also, your class should always be in capital letter "Student" not "student"

phorce 131 Posting Whiz in Training Featured Poster

Your class (.h) and functions to the class (.cpp) should be in separate files and then included in main (:

phorce 131 Posting Whiz in Training Featured Poster

Few questions:

- Will this be updated on a weekly basis? (Each team play once a week, maybe 2 times)
- Will the teams remain constant, in that, they can be called from the database for each week?

=)

phorce 131 Posting Whiz in Training Featured Poster

Hey, I was in completely the same situation you are in, I completely sucked at Mathematics.. But I'm studying Computer Science now, and my maths skills have improved so much!

Obviously, you'll need to sit mathematic classes and exams in order to do it but it's worth it - I guess!

phorce 131 Posting Whiz in Training Featured Poster

Hey there (Think this is what you're looking for):

First off your class:

class Sally
{
    public:
        Sally(); 

    private:
     
};

Only have public and private/protected etc.. Not twice =)

And the cpp file:

#include<iostream>
#include<string>
#include "Sally.h";

Sally::Sally(){};

Main:

#include <iostream>
#include "Sally.h"
using namespace std;

int main(){
    
    Sally so;
    
    return 0;
}

Should compile now =)

phorce 131 Posting Whiz in Training Featured Poster

I want a million pounds, doesn't mean I'll get it ;)

phorce 131 Posting Whiz in Training Featured Poster

Hi there, I am studying software engineering on my 3rd year and from time to time I think about the job I am gonna do during rest of my life.As a result I look at the trends of todays IT and application development world. There is a significant shift from system programming to desktop, web and mobile application development in recent decades. The reason is simple, it is commerialy more beneficial as it finds a quick application in todays industry. As a result it is popular and easier to grasp to non expert programmers. Here i might be wrong, cause writing clean and effiecient code takes time and experience. Anyway, the hole point is that I see myself being a coder, writing applications for some business companies as well as spending my spare time for learning some new technologies or maybe high level languages in order not to fall behind the market. I just want to hear from members who has experience in industry as well as students of the forum what do you think about this? Recently I got interested in system programming, although my course mainly oriented on aplication development. So, i find system programming more exciting than just coding in Java or in Python.

The industry is moving towards a more web and mobile application development, and the job market is flooded with PHP developers at the moment, especially in "open data".

I can see languages such as C++ and Java always having a place, however, …

phorce 131 Posting Whiz in Training Featured Poster

I try to stick to these standards where possible:

http://pear.php.net/manual/en/standards.php

However, I do stray sometimes when writing PURELY personal projects. Problem is, if I ever need to release the code to somebody else, for whatever reason, I find that I have to go and 'de-personalise' it. What a waste of time, if only I'd stayed on the standard track! :(

Yeah, I know what you mean.. I've learnt loads of "bad practices" when coding now to what I learnt a few years ago. :(

Thanks for everyones help btw =)

phorce 131 Posting Whiz in Training Featured Poster

Heyy.. I know what you mean, but, I'm not going to mix the HTML and PHP together. The idea is that the HTML aspect is separate and the PHP handles the HTML.. =)

phorce 131 Posting Whiz in Training Featured Poster

Hey, I'm building my own platform mainly for a project, but, for my own personal use as well.. I'm also changing the style of programming that I do it in, and, setting up some rules..

I just wondered if there are any disadvantages to the way that I am setting things out:

Everything in functions, no "stray" code and a different formatting to if statements:

<?php

   $app = new StdClass;
	
	function compare($number1, $number2)
	{ 
	   if($number1 > $number2):
	      return true;
	   else:
	      return false;
	    endif;
	}
	function main()
	{
		// Main is automatically outputted. 
		// And, for the application to work must be initalised.
		
		$app->Number1 = 19;
		$app->Number2 = 3;
		
		if(compare($app->Number1, $app->Number2)):
		  echo 'Yes';
		else:
		  echo 'No';
		endif;
            return 1;
	}
 ?>

Can anyone see any problems with using this style? =)

phorce 131 Posting Whiz in Training Featured Poster

Have you tried...

<?php 
include "db.php";
 
//Rows
$qtyRow = '<tr>';
$priceRow = '<tr>';
 
$nn=12; //Number of items, we split this later
 
$s=mysql_query("SELECT * FROM `test1`");
 
$c=mysql_num_rows($s);
 
if($c%$nn==0){
	$cc=$c/$nn;	
}else{
	$cc=$c/$nn+1;	
}
 
//$cc : Number of pages
 
$ss=@$_REQUEST['ss']; //Start position (eg: 6)
$other_tables = "";
 
if($ss=="" || $ss==null){
	$ss = 0; //Set to zero because it is incremented later
}
 
//Pages
echo "<table border=\"1\" align=\"center\">";
$sql=mysql_query("SELECT * FROM `test1` ORDER BY `id` DESC LIMIT $ss,$nn");
$inc = 0;
while($r=mysql_fetch_array($sql)){
	$id=$r['id'];  
	$name=$r['name'];
	if($inc == 0){
		$qtyRow .= "<tr>";
		$priceRow .= "<tr>";
	}
	$qtyRow .= "<td>$id</td>";
	$priceRow .= "<td>$name</td>";
	++$inc;
	if($inc == 3 || $inc == 6 || $inc == mysql_num_rows($sql)){
		//Display Table
		echo $qtyRow."</tr>";
		echo $priceRow."</tr>";
		echo "</table>";
 
		//To remove extra table
		if(mysql_num_rows($sql) <= 3){
			$inc = 7;
		}
 
		//Reset
		if($inc == 3){
			echo "<br><table border='1' align='center'>";
			$qtyRow = "<tr>";
			$priceRow = "<tr>";
		}
	}
}
echo "</table>";
$j=0;
echo"page : ";
for($i=1;$i<=$cc;$i++){
	echo"<a href=\"select.php?ss=$j\">$i</a>";
	echo"|";
	$j=$j+$nn; 
}
?>
phorce 131 Posting Whiz in Training Featured Poster

What language do you wanna work in? =)