Jump to content

PHP Code Help!


kamal213

Recommended Posts

Hi guys,

 

Can you tell me if it is possible. Let say you had a table which stores names and address (with a primary key and auto-increment) , and a PHP script which display every thing on you SQL Table dynamically.

 

Is it possible to write a PHP code such that if a name and address is added it display and its clickable "i.e. <a href="">$name,$address</a>", and if a new name and address is added its also clickable BUT the older/previous added become unclickable.

 

I would really appreciate your inputs

 

Thanks guys!

Link to comment
Share on other sites

$testArray = range(1,20);

That is a range, it saved me from doing this....(but now I see I'm doing it anyway)

same as

$testArray = array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20");

 

foreach will loop each value within the array

http://php.net/manual/en/control-structures.foreach.php

 

Arrays start at key position zero $value[0]

 

All i did is replace the first key value with something else

Link to comment
Share on other sites

Thanks QuickOldCar,

 

I take it the numbers in the array would for example be the items in my database table?

 

if yes can the code make the items from 0-19 unclickable and item 20 clickable? as this would exactly what am looking for and would solve the problem.

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.