PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > combobox and print query
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
combobox and print query

Réponse
 
LinkBack Outils de la discussion
Vieux 07/03/2008, 11h08   #1
lidlid@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut combobox and print query

Hi,

I have problem with php and MSSQL


I have a combobox with the name of 10 company and in my database i
have 1 table different for each company.


I need that when the user choose in the combobox one of this company
appeard the table with the data.


I think that I found part of the code that I need but i have no idea
how do that now


Please me!


<?php
session_start();
set_time_limit(0);
error_reporting(E_ALL);


//complete "stationsqlexpress" with your particular case
$SERVER = "stationsqlexpress";
$ADMIN_NAME = "sa";
//complete pass with your pass
$ADMIN_PASS = "pass";
//complete database witht the name of database you whant to
connect to
$DATABASE = "database";


$Conexion = mssql_connect($SERVER, $ADMIN_NAME, $ADMIN_PASS)
or die ("Can't connect to Microsoft SQL Server");


mssql_select_db($DATABASE, $Conexion)
or die ("Can't connect to Database");
?>


<form name="modulo">
<select name="colori" onchange="SelectPost()">
<option value=""></option>
<option value="ROSSO">ROSSO</option>
<option value="GIALLO">GIALLO</option>
<option value="VERDE">VERDE</option>
<option value="BLU">BLU</option>
</select>
</form>


<?php
$sql="SELECT * FROM anagrafe;
$oggetto = $mssql->runquery($sql);
$mssql->closeDb();
print ($oggetto);
?>


thanks Lidia
  Réponse avec citation
Vieux 07/03/2008, 18h52   #2
Vertigo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: combobox and print query

On Mar 8, 12:08 am, lid...@gmail.com wrote:
> Hi,
>
> I have problem with php and MSSQL
>
> I have a combobox with the name of 10 company and in my database i
> have 1 table different for each company.
>
> I need that when the user choose in the combobox one of this company
> appeard the table with the data.
>
> I think that I found part of the code that I need but i have no idea
> how do that now
>
> Please me!
>
> <?php
> session_start();
> set_time_limit(0);
> error_reporting(E_ALL);
>
> //complete "stationsqlexpress" with your particular case
> $SERVER = "stationsqlexpress";
> $ADMIN_NAME = "sa";
> //complete pass with your pass
> $ADMIN_PASS = "pass";
> //complete database witht the name of database you whant to
> connect to
> $DATABASE = "database";
>
> $Conexion = mssql_connect($SERVER, $ADMIN_NAME, $ADMIN_PASS)
> or die ("Can't connect to Microsoft SQL Server");
>
> mssql_select_db($DATABASE, $Conexion)
> or die ("Can't connect to Database");
> ?>
>
> <form name="modulo">
> <select name="colori" onchange="SelectPost()">
> <option value=""></option>
> <option value="ROSSO">ROSSO</option>
> <option value="GIALLO">GIALLO</option>
> <option value="VERDE">VERDE</option>
> <option value="BLU">BLU</option>
> </select>
> </form>
>
> <?php
> $sql="SELECT * FROM anagrafe;
> $oggetto = $mssql->runquery($sql);
> $mssql->closeDb();
> print ($oggetto);
> ?>
>
> thanks Lidia


Youve got a lot of reading to do. Youre going to need to assign an
onChange="yourfunctionname();" event to the select box, and then do an
ajax call to a script that will query the database and return the
second set of data for the next box.

Read about JQuery, AJAX, and javascript events.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h07.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11343 seconds with 10 queries