Jump to content

Search the Community

Showing results for tags 'sql'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 197 results

  1. I have a table called employee in which there's a field called birth_date. Iwant to get the output in the format of Jan-01-2013.My sql is $sql="SELECT emp_name,emp_address,salary,DATE_FORMAT(birth_date,'%b,%d,%Y') AS birth_date FROM employee";$query=mysql_query($sql,$connect); But the query is not succesful. What have I done wrong?Any help to correct this please
  2. I am needing to change the data type in a table but it won't allow me to. I usually manually drop and recreate a table but was going to try and use SQL server template since the table is rather large (right click on table-> script table as-> drop and create to) Would you suggest using this template or just manually writing it myself and going from there? IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblStaff]') AND type in (N'U'))DROP TABLE [dbo].[tblStaff]GOUSE [Test]GO/****** Object: Table [dbo].[tblStaff] Script Date: 07/10/2013 12:39:35 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [dbo].[tblStaff]( [StaffID] [bigint] NOT NULL, [LastName] [varchar](50) NULL, [FirstName] [varchar](50) NULL, [Status] [nvarchar](10) NULL, [FileNum] [int] NULL, [Supervisor] [nvarchar](150) NULL, [extension] [nvarchar](25) NULL, [JobID] [varchar](10) NOT NULL, [StartDate] [datetime] NULL, [EndDate] [datetime] NULL, [Note] [nvarchar](250) NULL, [Other] [nvarchar](150) NULL, [AddedBy] [nvarchar](50) NULL, [DateRecDeleted] [datetime] NULL, [DeletedBy] [nvarchar](50) NULL, [SSMA_TimeStamp] [timestamp] NOT NULL, [MachineName] [nvarchar](50) NULL) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO
  3. I am wanting to insert fields from a table (data types are varchar(50) into another empty table (who's data type is nvarchar(50)). I believe I have created the correct query to achieve this but received an error message when executing "Msg 8152, Level 16, State 4, Line 1 String or binary data would be truncated" Would these two data types be the cause of this? I'm using some other data types (int, bigint) that could possibly be the issue but these are the main ones used to I wanted to see about them first.
  4. I'm needing to insert values into a table. I have the data type set up as varchar(4). The values are combinations of 4 letters and/or numbers. When trying to insert it won't accepts the alpha characters. The column is set to Not Null and as the primary key. Any suggestions as to why it won't accept?
  5. I was needing to change the data type for a field in a table that was the primary key. After researching the solution I came up with was to drop the table and recreate it. I dropped the table and then attempted to recreate it only it wouldn't take the original table name so I modified it and inserted the columns into the table under the correct data types. I believe in doing this I messed something up. When I access the site that the database is tied to I can't view information for the table I recreated or the main table it's connected to. I have tried to go to the affected tables and correct this issue by trying to change it to new table information but I receive an error. Now I am at a standstill and unsure of what needs to be done next. Thanks
  6. I want to perform a join on three tables.Table 1: part_masterColumn: Item, Item_statusTable 2: Order_DetailsColumn: Item, order_num, order_typeTable 3: OrderColumn: order_num, order_typeHere is the cardinality:part_master <--> order_details (1..1)order <--> order_details (1..n)I want to perform a search on order table, to retrieve item_status from part_master. In other word, I want to see item_status, for an order, using order_num as a search criteria.I tries something like this, however, it throws a exception:select part_master.item_status from part_master where item = (select item from order_details where order_details.order_num = order.order_num)The error says, the second 'select' statement returns multiple results which is not correct..Help....!
  7. I would like to create a stored routine for MySQL that figures out the number of business or working days for a month (Working Days are Monday thru Friday). I have not created the procedure portion of it yet as I want to ensure that the code works first. Please note that there is a function called first_day. This is a function provided by my hosting provider. I also have another function for this that will figure out the first day of the month if I didn't have it from the hosting company. It is not currently used and can be removed for testing purposes. I am testing this through phpmyadmin SQL Query. phpmyadmin uses the mysql extension and not the mysqli extension processing if that makes a difference. (The hosting company refuses to update it). It's a syntax error however I don't know what the syntax error is. All it tells me is: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHILE(@daycount < @totaldays) DO IF (WEEKDAY(@checkweekday) < 6) THEN ' at line 2 My Syntax Error is in the following: WHILE(@daycount < @totaldays) DO IF (WEEKDAY(@checkweekday) < 6) THEN My Code: SELECT MONTH(CURDATE()) INTO @curmonth; SELECT MONTHNAME(CURDATE()) INTO @curmonthname; SELECT DAY(LAST_DAY(CURDATE())) INTO @totaldays; SELECT FIRST_DAY(CURDATE()) INTO @checkweekday; SELECT DAY(@checkweekday) INTO @checkday; SET @daycount = 0; SET @workdays = 0; BEGIN WHILE(@daycount < @totaldays) DO IF (WEEKDAY(@checkweekday) < 6) THEN SET @workdays = @workdays+1; END IF; SET @daycount = @daycount+1; SELECT ADDDATE('@checkweekday', INTERVAL 1 DAY) INTO @checkweekday; END WHILE; END; SELECT @workdays; I receive the same error with the following bit of code so it probably has something to do with this: SET @workdays = 0; IF (WEEKDAY('2013-06-13') < 6) THEN SET @workdays = @workdays+1; END IF; SELECT @workdays; Is someone able to assist?
  8. am searching the code for making pdf in asp classic, i have made a form in asp and on submit button i want that it get convert in pdf and get to attached in email. thanks in advance plz help
  9. Friends, i have 3 tables.....one named stocklist, other one....partyinsrcd, 3rd one.....sregisteri would like to select distinct vehicle model name from table stocklist whose related chassis numbers not available in the other two tables.......please help...Is this the sql for the above....pl check. i am not getting the result from the below sql......SELECT distinct stocklist.vehicle FROM (stocklist inner JOIN sregister ON stocklist.chassissregister.CHASSIS) inner JOIN partyinsrcd ON stocklist.chassisright(partyinsrcd.chassisno,7) WHERE (((sregister.CHASSIS)stocklist.chassis) and (right(partyinsrcd.chassisno,7)stocklist.chassis)
  10. Hey guys...it's me again...so, below you will find the script that I have that is supposed to update my database, however, it does NOTHING but return "Record Updated" and never updated anything. Any suggestions? $update = "UPDATE clients SET ( 'userid' = '{$_SESSION['myusername']}', 'cp_firstname' = '$_POST[cp_firstname]', 'cp_lastname' = '$_POST[cp_lastname]', 'cp_address' = '$_POST[cp_address]', 'cp_city' = '$_POST[cp_city]', 'cp_state' = ' $_POST[cp_state] ', 'cp_zip' = ' $_POST[cp_zip] ', 'cp_zip4' = ' $_POST[cp_zip4] ', 'cp_homeph' = '$_POST[cp_homeph] ', 'cp_workph' = '$_POST[cp_workph] ', 'cp_cellph' = '$_POST[cp_cellph] ', 'cp_email' = '$_POST[cp_email] ', 'alt_firstname' = '$_POST[alt_firstname] ', 'alt_lastname' = '$_POST[alt_lastname] ', 'alt_homeph' = '$_POST[alt_homeph] ', 'alt_cellph' = '$_POST[alt_cellph] ', 'non_firstname' = '$_POST[non_firstname] ', 'non_lastname' = '$_POST[non_lastname] ', 'non_home' = '$_POST[non_address] ', 'non_city' = '$_POST[non_city] ', 'non_state' = '$_POST[non_state] ', 'non_zip' = '$_POST[non_zip] ', 'non_zip4' = '$_POST[non_zip4] ', 'non_homeph' = '$_POST[non_homeph] ', 'non_workph' = '$_POST[non_workph] ', 'non_cellph' = '$_POST[non_cellph] ', 'non_email' = '$_POST[non_email] ', 'placeofemployment' = '$_POST[placeofemployment] ', 'datestart' = '$_POST[datestart] ', 'supportamount' = '$_POST[supportamount] ', 'judgmentdate' = '$_POST[judgmentdate] ', 'judge' = '$_POST[judge]', 'beg_bal' = '$_POST[beg_bal]' WHERE client_id='{$_SESSION['client_id']}')"; mysql_query($update);echo "Record updated"; Where'd I go wrong???
  11. Hi, I'm using SQL loader to load my data into database. Before I insert the data I need to remove existing data in the table: options(skip=1,load=250000,errors=0,ROWS=30000,BINDSIZE=10485760)load datainfile 'G:1.csv' "str '^_^'" replaceinto table IMPORT_ABCfields terminated by "," OPTIONALLY ENCLOSED BY '"'trailing nullcols(....) But I got error like: SQL*LOADER-926: OCI error while executing delete/truncate <due to REPLACE/TRUNCATE keyword> for table IMPORT_ABCORA-30036: unable to extend segment by 8 in undo tablespace 'undo1' How can I delete data for example by 10000 rows?I know that I have some limit on my DB.
  12. First, I would like to thank JUSTSOMEGUY for his extensive assistance with one hurdle on my report page. Now I need to do the calculations. Since I need my calculations to operate within 3 different IF statements and within the WHILE loop, I just guessed to put all the calculations after the beginning of the WHILE statement and before the first IF statement. Here is the code from WHILE statement to the first line of the report. However, NONE of the calculations are let someone live with them...ugh! while($monthStart <= $today){$payment_found = false; foreach ($payments as $payment) { $p = .08; //Percentage$dp = .08/365; // Returns Daily Percentage$datetime1 = new DateTime(strtotime('$monthStart')); //Get/Set Date 1$datetime2 = new DateTime(strtotime('$monthEnd')); // Get/Set Date 2//If first line of report, there won't be a $monthEndif (strtotime($monthEnd) <= 0) { $interval = 0;} else {$interval = $datetime1->diff($datetime2);}$dayslate = date('d', strtotime($interval));$intacc = ($dp * $dayslate) * $pmtamt;$appint = 1 * $intacc;$appprinc = $pmtamt - $appint;$bal = $pmtamt - ($appint + $appprinc);if (strtotime($payment['pmt_date']) >= $monthStart && strtotime($payment['pmt_date']) < $monthEnd) { $payment_found = true;if (strtotime($payment['pmt_date']) > $monthStart) {echo '<tr><td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. date("m.d.Y", $monthStart) . '</center></td>'; There's NO output in any fields, except "Days Late". (I added a Days Late column to my output table to see if it returns any values...it ONLY returns "31") Any suggestions....? (Not sure what I was trying to say before I edited that)
  13. I am creating an admission form which will ask for the information such as name, class, level, and such other information, so, I don't know how to connect to the database and how to make the database and how the database will store all that information. Can anybody explain it with real example with the code?
  14. Hello w3s.i'm not sure if i have asked in the right forum, was unsure if i should put the question in PHP or SQL area, anyways. i have attached a image where i show my so called forum so far made myself without trouble.Now i have ran into trouble that i would like to ask help for. LOOK AT PICTURE FOR THE IDEA here is my code: Menu: $HTMLOUT .= box_start("Forum Menu");$fm_res = mysql_query("SELECT * FROM mod_forum_menu ORDER BY fm_id ASC");$get_fc_id = (isset($_GET['fc_id']) ? '?fc_id='.$_GET['fc_id'].'&' : '?');//if isset...if (mysql_num_rows($fm_res) > 0)//if bigger than 0...{while($fm_array = mysql_fetch_assoc($fm_res))//fm = forum_menu{ $HTMLOUT .= "(<a href='forums_v1.php".$get_fc_id."fm_id=".$fm_array['fm_id']."' alt='".$fm_array['fm_name']."'>".$fm_array['fm_name']."</a>) ";}}else{$HTMLOUT .= "No forum menu added yet, please contact First Line Support for further information!...";}$HTMLOUT .= box_end(); Forum Categories: /*Category Forums...*/if(isset($_GET['fm_id'])){$fc_res = mysql_query("SELECT * FROM mod_forum_cats WHERE fc_id = ".$_GET['fm_id']);}else{$fc_res = mysql_query("SELECT * FROM mod_forum_cats ORDER BY fc_id ASC");}/*Category Forums...*/$get_fm_id = (isset($_GET['fm_id']) ? '?fm_id='.$_GET['fm_id']."&" : '?');//if isset...if (mysql_num_rows($fc_res) > 0)//if bigger than 0...{//$HTMLOUT .= "Forum(s) succes showed...<br />";while($fc_array = mysql_fetch_assoc($fc_res))//fc = forum_category{ $HTMLOUT .= "<div id='forum_cats_title_wrapper'>"; $HTMLOUT .= "<a href='forums_v1.php".$get_fm_id."fc_id=".$fc_array['fc_id']."'>".$fc_array['fc_name']."</a><-FORUM CATEGORY LIKE LH!..."; $HTMLOUT .= "</div>"; $HTMLOUT .= "<div id='under_forum_cats_title_wrapper'>"; $HTMLOUT .= "--<a href='#'>ACTUAL FORUM 1 HERE...</a><br />"; $HTMLOUT .= "--<a href='#'>ACTUAL FORUM 2 HERE...</a>"; $HTMLOUT .= "</div>";}}else{if($CURUSER['class'] >= UC_ADMIN)//equal or over ADMIN level for this message...{ $HTMLOUT .= " Admin Message:<br /><br /> Remember to add a Forum category before the real forums can be showed!...";}else{ $HTMLOUT .= "No forum categories added yet, please contact First Line Support for further information!...";}} now, i have done almost everything correct, i think, i have not errors so far.My trouble now lies in that i need to output the actual forums lying under the Forum Categories...how to do this in an another SQL?, the current one as you see is inside a while loop, and i should as far as i have been thinking, be in the same while loop... ideas?... PS:if you need more info, tell me so and i will try to explain in details of what i am doing, thanks again! ...
  15. Okay, here's HOW the code is supposed to work: Customer enters $startdate for a client in one form (info stored in one db table). Then customer enters several payments since $startdate. Then a report is automatically generated where the list on the left side of the report it automatically starts a date count from $startdate to $today. What I need to do is have the while loop pause, insert a payment entry based on date, then continue from there. There's also other things the report will do, but first thing's first...here's the working code that adds 1 month to the $startdate then stops when the payment date is entered into the while loop. ...require ('connect.php');$myusername = $_SESSION["myusername"];$data1 = mysql_query("SELECT * FROM clients WHERE client_id = ". $_SESSION['clientid'] ."") or die(mysql_error());$data = mysql_query("SELECT * FROM payments WHERE client_id = ". $_SESSION['clientid'] ." ORDER BY YEAR(pmt_date) ASC") or die(mysql_error());$row = mysql_fetch_assoc($data1);$row2 = mysql_fetch_assoc($data);$startdate = strtotime($row['datestart']);$today = strtotime('now');$pmt_date = strtotime($row2['pmt_date']);$amtdue = $row['supportamount'];...<p>Report for Client: <? echo $row['cp_firstname'] . " " . $row['cp_lastname'] ;?> <br /> <?phpecho '<table width="900" cellpadding="2" cellspacing="2">';echo '<tr><td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-left-style:dashed; border-right-style:dashed; border-width:thin;"><center>Date</center></td>';echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-left-style:dashed; border-right-style:dashed; border-width:thin;"><center>Amount Due</center></td>';echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-left-style:dashed; border-right-style:dashed; border-width:thin;"><center>Amount Paid</center></td>';echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed;border-left-style:dashed; border-right-style:dashed; border-width:thin;"><center>Interest Accumulated</center></td>';echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed;border-left-style:dashed; border-right-style:dashed; border-width:thin;"><center>Applied to Interest</center></td>';echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed;border-left-style:dashed; border-right-style:dashed; border-width:thin;"><center>Applied to Principle</center></td>';echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed;border-left-style:dashed; border-right-style:dashed; border-width:thin;"><center>Balance</center></td></tr>';while($startdate < $today){ echo '<tr><td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. date("m.d.Y", $startdate) . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$". $english_format_number = number_format($amtdue, 2, '.',',') .'</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$". $english_format_number = number_format($row2["pmt_amt"], 2, '.',',') . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$". $english_format_number = number_format($intacc, 2, '.',',') . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$". $english_format_number = number_format($appint, 2, '.',',') . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$". $english_format_number = number_format($appprinc, 2, '.',',') . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$". $english_format_number = number_format($bal, 2, '.',',') . '</center></td></td>'; $startdate = strtotime('+1 month', $startdate);}echo '</table>'; If there are any suggestions that you might be able to give me to rectify this particular issue, that would be FANTASTIC!!!
  16. Conan

    PHP Mail() Problem

    Hello everyone, I'm new here, and I don't know where am I suppose to post this, but I think it's here .So, as the title says, my problem is that I've made everything correct, but the mail doesn't send to my email, or to the email I want, but it passes the code (I mean it gives me that "successfuly sent"), but when I check my email, there is nothing . here is the code, please id there is anything wrong tell me <?PHPfunction checkrow11($query1) { $query = mssql_query($query1); if(mssql_num_rows($query) > 0) { return true; } else { return false; } }/////////////////////////////// Coded By Conan ///////////////////////////////////if(isset($_POST['recover'])){ $email = $_POST['emadd']; if($email == '') { $err = "Fill in all the empty fields please."; } else { if(checkrow11("SELECT * FROM Account WHERE Email = '".$email."'") == true) { $query111 = odbc_exec($connect, "SELECT UserID FROM Account WHERE Email = '".$email."'"); odbc_fetch_row($query111); $userid = odbc_result($query111, 1); $query112 = odbc_exec($connect, "SELECT Password FROM Login WHERE UserID = '".$userid."'"); odbc_fetch_row($query112); $pswd = odbc_result($query112, 1); $to = $email;$subject = "ID/Password Recover";$message = "Your UserID: ".$userid."<br>Your Password: ".$pswd;$headers = "From: Staff Team";$sent = mail($to, $subject, $message, $headers); if($sent){ $err="<font color='lightgreen'>Sent Successfuly.</font>";}else{ $err="Something went wrong, please try again later.";} } else { $err = "The E-mail you have entered is incorrect, or it's NOT found."; } }}?><div id="simplepage"><div id="simpletitle"><span style="margin-left:6px;">ID/Password Recovery</span></div><center><font size="2"><br><br>To recover your ID & Password, please enter your e-mail address in the field below.<br>The e-mail must be the ID's e-mail, you have used when you created the account.<br><br></font></center><form method="post" action=""><table id="registertable"><tr><td>Your E-Mail Address:</td><td><input type="text" maxlength="30" class="simpleinput" id="emadd" autocomplete="on" name="emadd"/></td></tr><tr><td><input type="Submit" name="recover" value="Recover !"></td><td></td></tr></table></form><br><br><center><font color="lightblue" size="2">A massage wil be sent to your e-mail, includes your ID/Password.</font></center><br><br><center><font color="pink" size="2"><?=$err;?></font></center></div>
  17. Hey Everyone! i have write this code for sending mail but it is not working. It is echoing the Error message. <?phpinclude "config.php";if(!$_POST) exit;$email = $_POST['email'];if(!preg_match('/\.([^\.]*$)/',$email )){$error.="Invalid email address entered";$errors=1;}if($errors==1) echo $error;else{$values = array ('name','email','message');$required = array('name','email','message'); $your_email = "aneeb@gmail.com";$email_subject = "New Message: ".$_POST['subject'];$email_content = "new message:\n";foreach($values as $key => $value){ if(in_array($value,$required)){ if ($key != 'subject' && $key != 'company') { if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; } } $email_content .= $value.': '.$_POST[$value]."\n"; }} if(@mail($your_email,$email_subject,$email_content)) { echo 'Message sent!';} else { echo 'ERROR!';}}?> Please help me..
  18. I have Table2 with a foreign key to Table1. I want to create a trigger that automatically update Table2 when Table1 is updated. Here is what's on my mind: create trigger MyTrigger on Table1 instead of update asif UPDATE(Table1_ID)begin declare @OldID as int, @NewID as int; select @OldID=P_ID from deleted; select @NewID=P_ID from inserted; update Table2 set Table1_ID=@NewID where Table2.Table1_ID=@OldID; update Table1 set Table1_ID=@NewID where Table1_ID=@OldID;end I received an error from SQL Server indicating that there was a conflict with the foreign key constraint when I tried to update a row. So I modified it a bit: create trigger MyTrigger on Table1 instead of update asif UPDATE(Table1_ID)begin declare @OldID as int, @NewID as int; select @OldID=P_ID from deleted; select @NewID=P_ID from inserted; update Table2 set Table1_ID=null where Table2.Table1_ID=@OldID; update Table1 set Table1_ID=@NewID where Table1_ID=@OldID; update Table2 set Table1_ID=@NewID where Table1_ID=null;end It does work. But pre-existing null values from Table2 are obviously lost if the trigger runs. What is the correct way to do this? Note that I already know of the cascading option when creating table. I just want to do it using trigger. Thanks. Note: I don't know how to loop through the inserted and deleted tables when multiple rows are updated. I'm assuming 1 row is updated at a time.
  19. ok, just quick... im getting this when trying to login: Unknown column 'e5035533a816cac4c54012281f58543d' in 'where clause' and this is my takelogin.php file: /*==========RUN LOGIN PROCEDURE===============*/$uname = sqlesc($_POST['username']); /*Form Names...*/$pass = sqlesc($_POST['password']); /*Form Names...*/if(isset($pass)){$passhash = md_5($pass); /*Securing The Data...*/}$query = "SELECT * FROM users WHERE username = $uname AND passhash = $passhash AND enabled = 'yes' AND status = 'confirmed'";$query_result = mysql_query($query)or die(mysql_error());//Running query to the DB...if(mysql_num_rows($query_result) == 1)/*if the DB returns somfthing, then run...*/{$row = mysql_fetch_array($query_result);$_SESSION['uid'] = $row['u_id'];$_SESSION['username'] = $row['username'];$_SESSION['pass'] = $row['passhash'];$_SESSION['status'] = $row['status'];$_SESSION['enabled'] = $row['enabled'];$_SESSION['email'] = $row['email'];$_SESSION['ip'] = $row['ip'];$_SESSION['class'] = $row['class'];$_SESSION['time_offset'] = $row['time_offset'];$_SESSION['dst_in_use'] = $row['dst_in_use'];$_SESSION['auto_correct_dst'] = $row['auto_correct_dst'];header('Refresh: 3; url=index.php');//with time delay...}else/*Error messeage...*/{$HTMLOUT .= "<center>Error reading login-session coding base, or a wrong username/pass inserted...</center>";header('Refresh: 3; url=index.php');//with time delay...}/*==========RUN LOGIN PROCEDURE===============*/ any ideas? Oo...
  20. Hello everybody, I have a little problem here...I have a XML file, that is a database itself containing information about terminology in two languages... This exemple file is to be "uploaded" into a MySQL databse, on Ubuntu, which is already built and ready to get the information from the XML files... The thing is: how can I start doing this uploading process? Is shell script a good way? Or is it better to use another tool? How? The file is here, attached. Thank you XML_exemple.mtf.xml
  21. equicidal

    data type mismatch

    When I try to run this update query in ms access 2007 I get an error box message that says "Data type mismatch in criteria expression". I know the problem is at the end around replace(property.[park city]," ","")=replace(locations2011.city," ",""). But I checked the data types for all the related columns, which is text, and they all match for both tables. If I put quotes around property.[park city] or remove the replace function from it, the query will run but obviously not how I want it to. I've tested this code with a smaller table and it works so what's the problem? UPDATE property, locations2011 SET property.county = locations2011.countyWHERE property.county Is Null And property.[park state]=locations2011.state And replace(property.[park city]," ","")=replace(locations2011.city," ",""); I know I can just remove all the spaces from the property table with ctrl+h replace all but I'd rather leave the data that's already there alone if possible.
  22. I'm probably too damaged of working with C# and LinQ, so havn't done a real SQL sentance since my work in Java.I have two tables, which are combined with a PK and FK. Table_MyCust with PK CustID and Table_CustApartments which contain CustID as FK.I want to make a XML document with PHP, where there is a node for each MyCust row, and for each MyCust there is a CustApartments for each apartment that have the current CustID as FK. In C# I've do something like the following: XElement xml = new XElement("customers", from p in DatabaseConnection.Custs orderby p.CustName select new XElement("customer", new XAttribute("customerName", p.CustName), new XElement("Addresses", (from l in p.Aparts.Distinct() orderby l.Street where l.Street != null && !l.Postal.Equals("1010") select new XElement("Address", (string)l.Street); ))); But how does I do in PHP? Does you create a SQL sentance with some kind of a join operation? Or do you create two SQL statments, and check for equals on the PK and FK while running through all the rows? I'm not sure whats the 'correct' way to do in PHP, since I'm fairly new to PHP scripting yet.
  23. So far i know that columns with 1-5 character should be marked as "Char" instead of "Varchar" because of less memory usage. Does this run SQL-database faster if i just choose certain values like SELECT name, password FROM account instead of SELECT * FROM account? Does it actually mater do i choose char or varchar?
  24. Need to convert some columns to different data type, but this statement will not work. Any idea what I am missing? (mgmt Studio has the first 'CAST' and 'AS' underlined. SELECT CAST [ETL_ID as int] as ETL_ID, NAMEX, DU_DEGREE_STATUS, DU_ESTS_DESC, Cast [bANNER_ID as (varchar(36),Null)]as BANNER_ID, DU_COLLEGE_DESC, cAST [DU_DEL_TERM_CODE_ADMIT as (VARCHAR(255),NULL)] AS DU_DEL_TERM_CODE_ADMIT, AGE, ETHNICITY_DESCRIPTION, GENDER, cAST [T1 as (VARCHAR(255),NULL)] AS T1, T1Status, cAST [T2 as (VARCHAR(255),NULL)] as T2, T2Status, cAST [T3 as (VARCHAR(255),NULL)] as T3, T3Status, cAST [T4 as (VARCHAR(255),NULL)] as T4, T4StatusFROM dbo.['Tracking 3$']
  25. Hello I have example database where is (Few values added) ID, SUBJECT, NAME1, Hello world, Mudsaf2, Hello world2, Mudsaf Then i get the data from sql with query (querys and row works perfectly <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script><script src="http://malsup.github.com/jquery.form.js"></script> <script> // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#removepost').ajaxForm(function() { alert("Something happened"); }); }); </script> <?php$query = "blablaablla"... untill while ($row = mysql_fetch_array($result)) { echo "<form id='removepost' method='post' action='script/removepost.php'> <input type='hidden' readonly='readonly' name='id' id='id' value='1' /> <input type='submit' name='submit' id='submit' value='Remove'></form>" . $row['SUBJECT']; } ?> The form works perfectly, but doesn't work with jQuery. http://malsup.com/jquery/form/ <--- This method doesn't work So im wondering is it possible to get that script work OR where do i link the jQuery files. So currenctly it goes to script/removepost.php, but it should stay at same page and let jQuery run the script whitout page refreshing/moving to action file. Should the form be changed from id to class and in jquery the #removepost to .removepost?
  • Create New...