Sql- Calling An Insert Via Functions, not working |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Web Design & Development Server Side Scripting Other Languages |
||
Sql- Calling An Insert Via Functions, not working |
||
Sep 27 2009, 07:11 PM
Post
#1
|
|
![]() Member ![]() ![]() Group: Members Posts: 90 Joined: 29-May 09 Member No.: 97,073 |
CODE <?php $ss= mysqli_connect($host,$user,$pass,$db) or die("ya did it wrong");//connect to db function createScroll($x) { $xx=$x; $ssq= "INSERT INTO scrolls(name) VALUES ('Dana')"; $ssres= mysqli_query($xx,$ssq) or die ("You messed xxxx"); } createScroll($ss); ?> for some reason i keep getting the error for the query. it can't connect to the DB no matter what i do. do i need to return any info to bring it back to the main program so it can update the DB? note that i tried it without the function braces and the db still wasnt updated |
|
|
The Seventh Hokage Sql- Calling An Insert Via Functions Sep 27 2009, 07:11 PM
swordz <?php
$ss= mysqli_connect($host,... Sep 27 2009, 10:19 PM
The Seventh Hokage okay. thanks to that error checking code segment i... Sep 28 2009, 08:54 PM
swordz The SQL comes first - it should be mysqli_query(... Sep 29 2009, 12:43 AM
The Seventh Hokage that causes an error that says "Warning: mysq... Sep 29 2009, 04:20 PM
swordz What errors are you getting?
Swordz
EDIT: Just s... Sep 29 2009, 05:47 PM
The Seventh Hokage i'm not sure what you mean by breaking the str... Sep 30 2009, 01:13 AM
swordz In PHP if you have something in " or ' th... Sep 30 2009, 09:21 AM
The Seventh Hokage ah okay. i am enlightened. i took a small break fr... Oct 1 2009, 01:07 PM
kobe james :rolleyes: Feb 1 2012, 06:59 AM ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 19th May 2013 - 05:22 PM |