Category : database

<?php // Insert data into mysql $sql= "INSERT INTO customer(customer-name, customer-street, customer-city)VALUES(:name, :street, :city)"; $result=mysql_query($sql); // if successfully insert data into database, displays message "Successful". if($result){ echo "Successful"; echo "<BR>"; echo "<a href=’insert.php’>Back to main page</a>"; } else { echo "ERROR"; } ?> <?php // close connection mysql_close(); ?> PHP is giving me a parse ..

Read more

$sql = "select customer-name, customer-city from customer where customer-name in (select distinct customer-name from depositor, account where depositor.account-number=account.account-number and account.branch-name=’Downtown’)"; $result = $conn->query($sql); if ($result->num_rows > 0) //LINE 18 { // output result in each row while($row = $result->fetch_assoc()) { echo "Name: ". $row[‘customer-name’]. " " . $row["customer-city"] . "<br>"; } } else { echo ..

Read more

Okay so I’ve been struggling with a problem I have to solve for class and I feel like I’ve made myself lost. I’m trying to take the choice from a drop down list and display a registered notification with the info displayed. Everything I’ve found hasn’t been a fix and everytime my code gets sloppier. ..

Read more

Well, thats pretty much it, i can’t insert the form data into the database. I have a connection with database, i can login with existing accounts, and i can see the news in the website etc, the database is connected, but when i click the submit button to register a new user it doesn’t work!! ..

Read more

So I’m creating some PHP connected to the World database (https://dev.mysql.com/doc/index-other.html). I’m getting an error that says: Warning: mysqli::__construct(): (HY000/1045): Access denied for user ”@’localhost’ (using password: NO) in C:xampphtdocsassignment11exercise2.php on line 12 Connection failed: Access denied for user ”@’localhost’ (using password: NO) This is for an assignment that said to: Write a PHP script ..

Read more

i have a migration "district_group_project_user: with following 4 UUID public function up() { Schema::create(‘district_group_project_user’, function (Blueprint $table) { $table->id(); $table->uuid(‘district_id’); $table->uuid(‘group_id’); $table->uuid(‘project_id’); $table->uuid(‘user_id’); $table->timestamps(); }); } and i have a function in each class in user class it is public function district_group_project_user() { return $this->belongsToMany(Project::class,’district_group_project_user’); } and in Project Class with the same name but ..

Read more