Jump to content

keyurshah

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

keyurshah's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I think you'll need to have a look at this: http://www.dynamicdrive.com/style/blog/entry/css-equal-columns-height-script/ Hope dis solves yer problems.
  2. Try this: $query = "SELECT VisIP, COUNT(DISTINCT(VisIP)) AS IPCnt FROM logs GROUP BY VisIP"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo "". $row['IPCnt'] ."ips" ; echo "". $row['VisIP'] ."ips" ; echo "<br />"; }
  3. <?php include('connect_db.php'); if( $_POST['toevoegen'] ){ $naam_ = $_POST['naam']; $voornaam_ = $_POST['voornaam']; $email_ = $_POST['email']; $query="INSERT INTO db_members(naam, voornaam, email) VALUES ('$naam_','$voornaam_','$email_')"; $result = mysql_query($query, $DBC) or die("Cannot connect: " . mysql_error()); } ?> <form action="results.php" name="survey" method="post"> <table cellspacing="0" cellpadding="3" class="tbl_survey"> <tr> <td>Naam:</td> <td><input type="text" name="naam" id="naam" /></td> </tr> <tr> <td>Voornaam:</td> <td><input type="text" name="voornaam" id="voornaam" /></td> </tr> <tr> <td>Email:</td> <td><input type="text" name="email" id="email" /></td> </tr> <tr> <td colspan="2"><input type="submit" value="submit" id="toevoegen" name="toevoegen" /></td> </tr> </table> </form>
  4. Change: $query="INSERT INTO db_members(naam, voornaam, email) VALUES ($naam_,$voornaam_,$email_)"; To: $query="INSERT INTO db_members(naam, voornaam, email) VALUES ('$naam_','$voornaam_','$email_')"; and then try...
  5. Need to arrange the queried data according to the vertical mode in phpmyadmin type
  6. Hi y'all 'freaky' family members, howz y'all? I need some of your guidance as I have found myself entangled in a problem. Well I have this three tables of make, model and version. The schema of the tables are as: MakeTable `makeid` int(4) NOT NULL auto_increment, `makename` varchar(100) NOT NULL default '', PRIMARY KEY (`makeid`) ModelTable `modelid` int(4) NOT NULL auto_increment, `makeid` int(4) NOT NULL default '0', `modelname` varchar(100) NOT NULL default '', PRIMARY KEY (`modelid`) VersionTable `versionid` int(4) NOT NULL auto_increment, `modelid` int(4) NOT NULL default '0', `versionname` varchar(100) NOT NULL default '', { Appr 85 Fields Here... } PRIMARY KEY (`versionid`) What I need to do is to prepare a report of version data. For that I have made this make dropdown wherein all the makes are shown. Then below that there is the model dropdown which is populate by model names according to the make selected. And finally a multiple select version dropdown which is populated by version names according to the model selected. A user can select multiple versions by ctrl+click. - Going fine till here After posting the form, I implode the versions and make a version search string like this: $num = count($_POST['versionone']); // number of versions selected $k = implode(",", $_POST['versionone']); // adding a comma after each versionid $version_string = "(".$k.")"; // preparing a string like (757,758,759,766,764) Then, the sql: SELECT VersionTable.*, ModelTable.modelid, ModelTable.modelname, MakeTable.makeid, MakeTable.makename, nwveh_vtype.vtypename, nwveh_vtype.vtypeid FROM VersionTable INNER JOIN ModelTable ON ModelTable.modelid=VersionTable.modelid INNER JOIN MakeTable ON MakeTable.makeid=ModelTable.makeid WHERE VersionTable.versionid IN (757,758,759,766,764)" The above sql gives the desired results but not a the above table. Need to arrange the queried data according to the table below: 1.1 iRDE Era 1.1 iRDE Magna 1.2 Kappa Magna 1.2 Kappa Magna AT Engine Displacement 1234 cc 2345 cc 3456 cc 4567 cc Engine Type Inline SOHC Inline SOHC Inline SOHC Inline SOHC Power 50Bhp@3200 63Bhp@3200 63Bhp@3200 70Bhp@3200 Torque 180Nm@1440-1500 180Nm@1440-1500 180Nm@1440-1500 180Nm@1440-1500 Transmission Manual Manual Automatic Automatic So on.... Thanks, Keyur
  7. The 'headers' redirection wuz also troubling me. What I did wuz simply wrote a small function: function redirect($loc){ echo "<script>window.location.href='".$loc."'</script>"; } and then function GoHere(){ /* Do something here... */ redirect('index.php'); } and it worked! Hope this helps.
  8. keyurshah

    help

    This should help enough! http://www.php.net/manual/en/function.preg-match.php
  9. This line: Are you assigning the value to $up or comparing. Currently it seems that you are comparing (==). If you are assigning then it should be just =; Try assigning and then echo.
  10. ProjectFear, You da man... Awesome. Never thought I would get the correct reply so quickly. Works Perfect. Thanks a ton!
  11. Hello my freaky family members. A small help is needed. I get a set of prices whenever a user selects a vehicle make. Say a user selected a make called Ford, then I get the price set as 'From' price is 456980 and the 'To' price is 678698. I need to display the 'From' price at the lowest, meaning if it is 456980 then it should show 400000 and the 'To' price at the highest, meaning if it is 678698 then it should show 700000. Can anyone help? I have tried using round() but to no avail. Using ceil() and floor() are probably immaterial as my 'From' and 'To' values are not in decimals. Any help will be highly appreciated. Thanks in advance!
  12. Sorted out myself. When you do a lot of coding you tend to make the simplest of the mistakes. Here in my case, there was no need for joining all the tables. As I already had the makeid, I simply queried the price table (where makeid is the FK) using the makeid and then sorted out the results (max and min) and VOILA. So sorry but anyways thanks fellas, who took the trouble to even view this thread.
  13. Hey freaks family, howz ya'all. I need a small help. I have four tables like make, model, version and prices. Make table has two cols makeid (PK) and makename. Model table has three cols modelid (PK) makeid (FK) and modelname. Version table has 10+ cols but for relating with above two, the cols are versionid(PK), modelid (FK) and versionname The Price table has cols such as pid(PK), makeid, modelid, versionid, prcmum, prcdel, prcban and prcche. Now supposing, a makeid is 6 and the makename is Ford. The make Ford (details in the make table) has 3 models (details in the model table) and each model has 4 versions (details in the version table) By the makeid I need to get the max price and the min price from the price table of just one city ie (prcmum) By doing this: SELECT DISTINCT(nwveh_model.modelid), nwveh_make.makename, nwveh_make.makeid, max(case when nwveh_exshowroomprices.prc_mum!=0 or nwveh_exshowroomprices.prc_mum!=null or nwveh_exshowroomprices.prc_mum!='-NA-' then nwveh_exshowroomprices.prc_mum end ) AS maxprice, min(case when t.prc_mum!=0 or t.prc_mum!=null or t.prc_mum!='-NA-' then t.prc_mum end ) AS minprice FROM nwveh_model INNER JOIN nwveh_make ON nwveh_make.makeid=nwveh_model.makeid INNER JOIN nwveh_version ON nwveh_version.modelid=nwveh_model.modelid INNER JOIN nwveh_exshowroomprices ON nwveh_exshowroomprices.modelid=nwveh_model.modelid INNER JOIN nwveh_exshowroomprices as t ON t.modelid=nwveh_model.modelid WHERE nwveh_model.makeid='6' and nwveh_model.modelstatus='Y' GROUP BY nwveh_model.modelname ORDER BY nwveh_model.modelname ASC I get four records of each models max and min prices of models like this: modelid makename makeid maxprice minprice 32 Ford 6 1860140 1604235 34 Ford 6 853956 657804 35 Ford 6 720000 625706 36 Ford 6 483000 483000 what I actually want is just the max and the min price and make id, like this makeid maxprice minprice 6 1860140 483000 Please help me change my query so that I can get my desired results! Help Family! Thanks in advance!
  14. Correction: Path across the site for menu.html will be: include ($ROOT_URL."/onikz/menu.html");
  15. Assuming that 'si' is your root directory. $ROOT_URL =$_SERVER["DOCUMENT_ROOT"]."/si"; Now your $ROOT_URL will be C:/xampp/htdocs/si Suppose your menu.html sits in C:\xampp\htdocs\si\onikz Now your include path across the site for menu.html will be: include ($ROOT_URL."/si/onikz/menu.html"); Hope this helps.
×
×
  • 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.