Jump to content

rbvinc

Members
  • Posts

    35
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rbvinc's Achievements

Member

Member (2/5)

0

Reputation

  1. Yes it worked with little tweaks. I am good with asp, but some how php syntax is getting me. I will better off soon. THANK YOU ALL FOR YOUR HELP.
  2. Agreed Sirs. Thank you all, took your suggestions. One last help 'PLEASE'. I got this connection, select * from countryTable where country ='USA' All below listed data is there, now I am trying to get/display in a table rest of these rows data with loop. Like, COUNTRY - STATE - CITY - SCHOOL# USA - Pennsylvania - Pittsburgh - 124 USA - Pennsylvania - Harrisburg - 126 USA - Pennsylvania - Strougtsburg - 177 so on.... Please help.
  3. Please see code below, all connections working. but some how when I select with 'where' is not working. Please fix this, as well I want to display other records in table. Thank you, I can display 'country' on this page when I submit from 'form' selectoion. But could not get rest of the data for that country. Error is 'syntax' error. $query = "select * from countryTable where country = ".$_post['country']. " order by country asc";
  4. rbvinc

    PHP, MySql

    Jesirose, if can, please modify my code, make work, it will be a lifetime Thank you, I tried could not follow. Once I cross this, then I am on my own please. I will be help to other people. Thank you in advance.
  5. rbvinc

    PHP, MySql

    Jesirose, if you can help me fixing my code, it will be a life time help. I tried, could not figure it out please. Thank you in advance.
  6. rbvinc

    PHP, MySql

    Jesi, I asked for help.... if you can help me out. Once I cross then I am on my own... Thanks,
  7. rbvinc

    PHP, MySql

    Erdy, I know it is wrong, but this what I have..... Output to be, Canada . companyone . companytwo . companythree USA . xyz company . zy company . xz comapy so on... ****************************** ************* <?php $con = mysql_connect("localhost","root","test"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("northwind", $con); $result = mysql_query("SELECT distinct country FROM customers order by country"); echo "<table border='1'> <tr> <th>Country</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr bgcolor='#808080'>"; echo "<td>" . $row['country'] . " </td>"; echo "</tr>"; echo "</table>"; $result1 = mysql_query("SELECT * FROM customers where country = " . $row['country'] . " order by country"); echo "<table border='1'> <tr> <th colspan='2'>Company Name</th> </tr>"; echo "<tr>"; if ($result1) { echo "<td>" . $row['Region'] . " </td>"; echo "<td>" . $row['country'] . " </td>"; } echo "</tr>"; echo "</table>"; } mysql_close($con); ?>
  8. rbvinc

    PHP, MySql

    Erdy, I tried. No luck.
  9. rbvinc

    PHP, MySql

    It is not copy and paste, I am so good with ASP, I copied ASP code, modified into PHP, to do the same process, and besides learning PHP, since got stuck I came here for help. If can please do help. This is not commercial. I am usinging northwind.mdb sample database for learning. Thank you,
  10. rbvinc

    PHP, MySql

    I am lost. Can give me code for that looping please. Thank you, table = customers fields = country, companyname
  11. rbvinc

    PHP, MySql

    I have about 100 records, but my loop is looping so many times, returning 1000+ repeated records. I need something like this. Help me out please with new code. Thanks. Canada . companyone . companytwo . companythree USA . xyz company . zy company . xz comapy so on...
  12. rbvinc

    PHP, MySql

    Sorry... ************ <?php $con = mysql_connect("localhost","root","test"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("northwind", $con); $result = mysql_query("SELECT Country FROM customers order by country"); echo "<table border='1'> <tr> <th>Country</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Country'] . " </td>"; $result1 = mysql_query("SELECT * FROM customers where country = " . $row['Country'] . " order by CompanyName"); echo "<table border='1'> <tr> <th>Company Name</th> <th>Country</th> </tr>"; while($row = mysql_fetch_array($result1)) { echo "<tr>"; echo "<td>" . $row['CompanyName'] . " </td>"; echo "<td>" . $row['Country'] . " </td>"; echo "</tr>"; } echo "</table>"; } echo "</tr>"; echo "</table>"; mysql_close($con); ?>
  13. rbvinc

    PHP, MySql

    I am new, learing PHP. What I am trying to do is, first I want to put country, under each counrty I want to put companynames. Below is my code. Can some one fixit it please for me. Thank you. Example below, Canada . companyone . companytwo . companythree USA . xyz company . zy company . xz comapy so on...
  14. I am using MS Access, winxp, ASP. The following code works fine in ASP when I select only one country. If check two or more countries, it does not work. Can you please modify the following code to work in PHP if I select 1 or 2 or 3 or more countries. Thank you in advance. PLEASE NEED PHP CODE. ---------- <html> <head> <title>Untitled</title> </head> <body> <% if request.form("country") = "" then %> <form action='aspformdata.asp' method="post"> <input type="checkbox" name="COUNTRY" value="USA">USA<br> <input type="checkbox" name="COUNTRY" value="Canada">Canada<br> <input type="checkbox" name="COUNTRY" value="Denmark">Denmark<br> <input type="checkbox" name="COUNTRY" value="China">China<br> <input type="checkbox" name="COUNTRY" value="Japan">Japan<br> <input type='submit' name='submit' value='Submit'> </form> <% Else %> <% set cn = server.createObject("ADODB.Connection") cn.open "dsn=northwind" courntry = request.form("country") %> <% sql = "select * from customers where country = '" & request.form("country") & "' order by country" set rs = server.createObject("ADODB.RecordSet") rs.open sql, cn %> <table> <tr> <td> CompanyName</font></td><td> City</font></td><td> State</font></td> </tr> <% Do Until rs.EOF %> <tr> <td> <%= rs("CompanyName")%></font> </td> <td> <%= rs("City")%></font></td> <td> <%= rs("State")%></font> </td> </tr> <% rs.movenext loop %> <% End if%> </table> </body> </html>
  15. Or if somebody can help me with mysql, php code. Thank you in advance.
×
×
  • 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.