PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 27th, 2012, 04:31 PM
BHB BHB is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 2 BHB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 56 sec
Reputation Power: 0
Forms: POST & GET - Populate radio from sql DB

Hello, I am new here but I see much activity and great answers.

quick background:
I am new to PHP/SQL in last year. Studying on my own so there are holes in my learning! I have a personal project to rebuild my own web site for horse breeding. Pedigrees and number of horses can be exhausting in html.

I have a basic table, horse id, horsename, gender year born, sire id, dam id and when a new horse is added default for sire and dam are unkown - at this point!

I build a little search code so I can enter a name in text box form and POST to next page (POST to curent page when I get it all worked out, maybe). So next page recieves just the POST text, runs it through search and query, returns array.

$r looks like this: mysqli_result Object ( [current_field] => 0 [field_count] => 8 [lengths] => [num_rows] => 12 [type] => 0 )

1

and $row, fetch array NUM looks like this as example:

Array ( [0] => 15 [1] => Cor de la Bryere [2] => 1 [3] => 0000 [4] => 1 [5] => 2 [6] => 15 [7] => Cor de la Bryere )

1
Array ( [0] => 19 [1] => R-Saluut II [2] => 1 [3] => 0000 [4] => 1 [5] => 2 [6] => 19 [7] => R-Saluut II )

1
Array ( [0] => 48 [1] => Quidam de Revel [2] => 1 [3] => 1990 [4] => 1 [5] => 2 [6] => 48 [7] => Quidam de Revel )

1


Side note, I do not know where this '1' is coming from, end of each array. I am guesising this is my clue. This exact $r/$row does populate a table.... soo not sure what is wrong with array, if anything. Array above has a second table that lists only sires/males (field 6 and 7).

I can't get it to populate a radio list. I get the last horse to popluate one radio button but I would like all of them with the last option to be a radio button = I do not see the horse I am looking for and on to add a new horse.

<code>
$hid = $row[0];
$hsirename = $row[1];
$hborn = $row[3];
</code>

tried this:

<code>
<php echo "<label><input type=\"radio\" name=\"sire\" value=\"". $hid ."\">$hsirename</label>"; >
</code>
and this:

<code>
<input type="radio" name="sire" value= "existing" <php echo $hid; > /> New Sire? <php echo $hsirename; ><php echo $hborn; >
</code>


and I am no closer,..do I need a for each instead of while($row = mysqli_fetch_array($r, MYSQLI_NUM)) { ??? I did not need a for each in drop menu and don't know why radio would be different.


So, I get my sire and dam list to return these radio list, choose one of each OR add new names for sire and dam, then go on to next page to update the DB... I guess that is another tricky issue. I have to keep the original horse id in a hidden field to carry forward with this info. I am not even going to try an pull this off on one page.. someday this will seem like silly beginner stuff.

THANK YOU!!!!!!!!!!!!

BHB

Reply With Quote
  #2  
Old August 28th, 2012, 03:34 AM
Frank451 Frank451 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 3 Frank451 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 0
Have you tried to import the data inside a new database file? If not then try to do it. It could solve your problem.URLURLURL

Reply With Quote
  #3  
Old August 28th, 2012, 08:06 AM
BHB BHB is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 2 BHB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 56 sec
Reputation Power: 0
Hmm windows problem? Or corrupted db? K.. I will check. Thanks. I would not have thought of that.

Reply With Quote
  #4  
Old December 3rd, 2012, 12:28 AM
stevarbour3 stevarbour3 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 stevarbour3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 44 sec
Reputation Power: 0
If you want help on the TransferSpreadsheet function, put the cursor over it and press F1.





Reply With Quote
  #5  
Old December 3rd, 2012, 06:45 AM
Beve3rly Beve3rly is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 Beve3rly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 34 sec
Reputation Power: 0
I would not have thought of that.


Reply With Quote
  #6  
Old December 5th, 2012, 01:42 AM
corbidougu corbidougu is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 corbidougu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 53 sec
Reputation Power: 0
I would not have thought of that.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Forms: POST & GET - Populate radio from sql DB


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap