|
|
|
ODBC - PHP
|
|||
|---|---|---|---|
|
#18+
Wsem privet!. Takoj wopros. S pomoz'ju php skripta i ODBC ja podkljutshajus' k base (.mdb). Esli eta basa nahoditsja na lokal'nom diske to wse w porjadke - podkljutschenie proishodit, no esli na setewom to -wot takaja oschibka Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Das Microsoft Jet-Datenbankmodul kann die Datei '(unbekannt)' nicht цffnen. Sie ist bereits von einem anderen Benutzer exklusiv geцffnet, oder Sie benцtigen eine Berechtigung, um die Daten lesen zu kцnnen., SQL state S1000 in SQLConnect in D:\server\www\index.php on line 35 Wot moj skript: <? if ($text3 != ""){ // Parametry bazy dannyx dlja podkljychenija $base_name="AuftragsAbteilung"; $admin_name="admin"; $secret_word=""; $table_name="AuftragAbteilung"; // * // Ochistka ot znaka ' on vuzuvaet oshibky i nebol'shaja obrabotka dannux $text1 = str_replace('\'', '', $text1); $text2 = str_replace('\'', '', $text2); $text3 = str_replace('\'', '', $text3); $text4 = str_replace('\'', '', $text4); $text5 = str_replace('\'', '', $text5); $text6 = str_replace('\'', '', $text6); if (($day0 != "") AND ($month0 != "") AND ($year0 != "")) {$text7 = $day0.".".$month0.".".$year0;} else{$text7 = "01.01.01";} $text8 = $day1.".".$month1.".".$year1; $text9 = str_replace('\'', '', $text9); $text5 = substr($text5, 0, 50); //$dat = date("d.m.y"); //if ($text8 == ""){$text8 = $dat;} if ($cbox == "True"){$cbox=1;}else{$cbox=0;} if ($radiobutton1 == "True1"){$sofort=1;$wochen=0;}elseif($radiobutton1 == "True2"){$wochen=1;$sofort=0;}else{$wochen=0;$sofort=0;} if ($radiobutton == "True3"){$ja=1;$nein=0;}elseif($radiobutton == "True4"){$nein=1;$ja=0;}else{$ja=0;$nein=0;} // * // Postroenie zaprosa i dobawlenie w tablicy. $odbc=odbc_connect($base_name, $admin_name, $secret_word) or die(odbc_errormsg()); $q="insert into ".$table_name." ([Abteilung],[Kostenstelle],[Name],[Telefon],[Standort],[Beschreibung],[GBlatt],[Sofort],[Wochen],[ BisZumDatum],[Datum],[Unterschrift],[KostenJa],[KostenNein]) values('$text1', '$text2', '$text3', '$text4', '$text5', '$text6', '$cbox', '$sofort', '$wochen', '$text7', '$text8', '$text9', '$ja', '$nein')"; print $q; odbc_exec($odbc, $q) or die("<p>".odbc_errormsg()); // * // Blagodarim za to chto .... //print $danke; include ("danke.htm"); exit; } include ("./form_0.htm"); $day = "";$month="";$year=""; for ($i=0;$i<32;$i++){ $x=sprintf("%02d", $i); if ($i>0){ if ($x == date(d)){$sel="selected";}else{$sel="";} $day0=$day0."<option value='".$x."'> ".$x." </option>\n"; $day1=$day1."<option value='".$x."' ".$sel."> ".$x." </option>\n"; } if (($i < 13) AND ($i > 0)){ if ($x == date(m)){$sel="selected";}else{$sel="";} $month0=$month0."<option value='".$x."'> ".$x." </option>\n"; $month1=$month1."<option value='".$x."' ".$sel."> ".$x." </option>\n"; } if (($i > 3) AND ($i < 15)){ if ($x == date(y)){$sel="selected";}else{$sel="";} $year0=$year0."<option value='".$x."'> 20".$x." </option>\n"; $year1=$year1."<option value='".$x."' ".$sel."> 20".$x." </option>\n"; } } print "<select name='day0' class='enter'><option value='' selected>--</option>\n".$day0."</select>\n\n"; print "<select name='month0' class='enter'><option value='' selected>--</option>\n".$month0."</select>\n\n"; print "<select name='year0' class='enter'><option value='' selected>--</option>\n".$year0."</select>\n\n"; "</td><td> </td></tr><tr><td> </td><td> </td><td> </td><td> </td></tr><tr> <td> </td><td colspan=\"2\" class=\"tdtext\">Datum:"; print "<select name='day1' class='enter'>".$day1."</select>\n\n"; print "<select name='month1' class='enter'>".$month1."</select>\n\n"; print "<select name='year1' class='enter'>".$year1."</select>\n\n"; include ("./form_1.htm"); ?> Saranie sposibo ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 01.09.2004, 14:23:06 |
|
||
|
|

start [/forum/topic.php?fid=45&tid=1672045]: |
0ms |
get settings: |
5ms |
get forum list: |
8ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
47ms |
get topic data: |
6ms |
get forum data: |
2ms |
get page messages: |
21ms |
get tp. blocked users: |
1ms |
| others: | 205ms |
| total: | 299ms |

| 0 / 0 |
