MarcusZ Posted February 16, 2010 Share Posted February 16, 2010 Please help I'm quite new to this. I don't get an error message. but when I run a test the database on myphpadmin doesn't recieve the new data. I've checked that the connection is right. mysql_select_db("smsinfo", $con); $sql = "INSERT INTO `smsinfo`.`history` ( `time` , `number` , `sms` , `price` , `smssent` ) VALUES (NOW(),$nr,$sms,$tariff,1"; mysql_query( $sql, $con); $affected = mysql_affected_rows($con); mysql_close($con); echo 'Vi har nu tagit emot ditt SMS! ' . $affected . '!'; Quote Link to comment https://forums.phpfreaks.com/topic/192231-new-data-problem/ Share on other sites More sharing options...
Alex Posted February 16, 2010 Share Posted February 16, 2010 You're missing a closing ): $sql = "INSERT INTO `smsinfo`.`history` ( `time` , `number` , `sms` , `price` , `smssent` ) VALUES (NOW(),$nr,$sms,$tariff,1)"; Quote Link to comment https://forums.phpfreaks.com/topic/192231-new-data-problem/#findComment-1013006 Share on other sites More sharing options...
MarcusZ Posted February 16, 2010 Author Share Posted February 16, 2010 Thank you for your reply. However, the problem remains. I still don't manage to save the data to the db. I'm very new to this, so the problem might be that I have done a wrong/bad setup or something. This file is published on my filehost, and it should be contacted by another sever with data, which should be passed on and saved to myphpadmin.com. Am I missing something? Is that all I need to do? I havn't installed anything. Quote Link to comment https://forums.phpfreaks.com/topic/192231-new-data-problem/#findComment-1013338 Share on other sites More sharing options...
MarcusZ Posted February 16, 2010 Author Share Posted February 16, 2010 I think that I've solved it now, I don't know how but it works now. thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/192231-new-data-problem/#findComment-1013394 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.